blob: 4134d28c4391b85468cf7ac142d044b32b93057b [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 *
Chien-Yu Chen5398a672015-03-19 14:48:43 -0700298 * <p>For the same type of request (capturing from the camera device or reprocessing), this
299 * value monotonically increments, starting with 0, for every new result or failure and the
300 * scope is the lifetime of the {@link CameraDevice}. Between different types of requests,
301 * the frame number may not monotonically increment. For example, the frame number of a newer
302 * reprocess result may be smaller than the frame number of an older result of capturing new
303 * images from the camera device, but the frame number of a newer reprocess result will never be
304 * smaller than the frame number of an older reprocess result.</p>
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700305 *
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700306 * @return The frame number
Chien-Yu Chen5398a672015-03-19 14:48:43 -0700307 *
308 * @see CameraDevice#createCaptureRequest
309 * @see CameraDevice#createReprocessCaptureRequest
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700310 */
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700311 public long getFrameNumber() {
312 return mFrameNumber;
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700313 }
314
315 /**
316 * The sequence ID for this failure that was returned by the
Eino-Ville Talvala0a160ac2014-07-02 14:29:26 -0700317 * {@link CameraCaptureSession#capture} family of functions.
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700318 *
319 * <p>The sequence ID is a unique monotonically increasing value starting from 0,
320 * incremented every time a new group of requests is submitted to the CameraDevice.</p>
321 *
322 * @return int The ID for the sequence of requests that this capture result is a part of
323 *
Eino-Ville Talvalafd887432014-09-04 13:07:40 -0700324 * @see CameraDevice.CaptureCallback#onCaptureSequenceCompleted
325 * @see CameraDevice.CaptureCallback#onCaptureSequenceAborted
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700326 */
327 public int getSequenceId() {
328 return mSequenceId;
329 }
330
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700331 /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
332 * The key entries below this point are generated from metadata
333 * definitions in /system/media/camera/docs. Do not modify by hand or
334 * modify the comment blocks at the start or end.
335 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/
336
337 /**
Zhijun He379af012014-05-06 11:54:54 -0700338 * <p>The mode control selects how the image data is converted from the
339 * sensor's native color into linear sRGB color.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700340 * <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 -0700341 * control is overridden by the AWB routine. When AWB is disabled, the
342 * application controls how the color mapping is performed.</p>
343 * <p>We define the expected processing pipeline below. For consistency
344 * across devices, this is always the case with TRANSFORM_MATRIX.</p>
345 * <p>When either FULL or HIGH_QUALITY is used, the camera device may
346 * do additional processing but {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
347 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} will still be provided by the
348 * camera device (in the results) and be roughly correct.</p>
349 * <p>Switching to TRANSFORM_MATRIX and using the data provided from
350 * FAST or HIGH_QUALITY will yield a picture with the same white point
351 * as what was produced by the camera device in the earlier frame.</p>
352 * <p>The expected processing pipeline is as follows:</p>
353 * <p><img alt="White balance processing pipeline" src="../../../../images/camera2/metadata/android.colorCorrection.mode/processing_pipeline.png" /></p>
354 * <p>The white balance is encoded by two values, a 4-channel white-balance
355 * gain vector (applied in the Bayer domain), and a 3x3 color transform
356 * matrix (applied after demosaic).</p>
357 * <p>The 4-channel white-balance gains are defined as:</p>
358 * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} = [ R G_even G_odd B ]
359 * </code></pre>
360 * <p>where <code>G_even</code> is the gain for green pixels on even rows of the
361 * output, and <code>G_odd</code> is the gain for green pixels on the odd rows.
362 * These may be identical for a given camera device implementation; if
363 * the camera device does not support a separate gain for even/odd green
364 * channels, it will use the <code>G_even</code> value, and write <code>G_odd</code> equal to
365 * <code>G_even</code> in the output result metadata.</p>
366 * <p>The matrices for color transforms are defined as a 9-entry vector:</p>
367 * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} = [ I0 I1 I2 I3 I4 I5 I6 I7 I8 ]
368 * </code></pre>
369 * <p>which define a transform from input sensor colors, <code>P_in = [ r g b ]</code>,
370 * to output linear sRGB, <code>P_out = [ r' g' b' ]</code>,</p>
371 * <p>with colors as follows:</p>
372 * <pre><code>r' = I0r + I1g + I2b
373 * g' = I3r + I4g + I5b
374 * b' = I6r + I7g + I8b
375 * </code></pre>
376 * <p>Both the input and output value ranges must match. Overflow/underflow
377 * values are clipped to fit within the range.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700378 * <p><b>Possible values:</b>
379 * <ul>
380 * <li>{@link #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX TRANSFORM_MATRIX}</li>
381 * <li>{@link #COLOR_CORRECTION_MODE_FAST FAST}</li>
382 * <li>{@link #COLOR_CORRECTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
383 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700384 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
385 * <p><b>Full capability</b> -
386 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
387 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He379af012014-05-06 11:54:54 -0700388 *
389 * @see CaptureRequest#COLOR_CORRECTION_GAINS
390 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
391 * @see CaptureRequest#CONTROL_AWB_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700392 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He379af012014-05-06 11:54:54 -0700393 * @see #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX
394 * @see #COLOR_CORRECTION_MODE_FAST
395 * @see #COLOR_CORRECTION_MODE_HIGH_QUALITY
396 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700397 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700398 public static final Key<Integer> COLOR_CORRECTION_MODE =
399 new Key<Integer>("android.colorCorrection.mode", int.class);
400
401 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800402 * <p>A color transform matrix to use to transform
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700403 * from sensor RGB color space to output linear sRGB color space.</p>
Zhijun He49a3ca92014-02-05 13:48:09 -0800404 * <p>This matrix is either set by the camera device when the request
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800405 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700406 * directly by the application in the request when the
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800407 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p>
Zhijun He49a3ca92014-02-05 13:48:09 -0800408 * <p>In the latter case, the camera device may round the matrix to account
409 * for precision issues; the final rounded matrix should be reported back
410 * in this matrix result metadata. The transform should keep the magnitude
411 * of the output color values within <code>[0, 1.0]</code> (assuming input color
412 * values is within the normalized range <code>[0, 1.0]</code>), or clipping may occur.</p>
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -0800413 * <p>The valid range of each matrix element varies on different devices, but
414 * values within [-1.5, 3.0] are guaranteed not to be clipped.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700415 * <p><b>Units</b>: Unitless scale factors</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700416 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
417 * <p><b>Full capability</b> -
418 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
419 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800420 *
421 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700422 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700423 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700424 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700425 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> COLOR_CORRECTION_TRANSFORM =
426 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.colorCorrection.transform", android.hardware.camera2.params.ColorSpaceTransform.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700427
428 /**
Igor Murashkin7d2a5c52014-01-17 15:07:52 -0800429 * <p>Gains applying to Bayer raw color channels for
Zhijun Hecc28a412014-02-24 15:11:23 -0800430 * white-balance.</p>
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700431 * <p>These per-channel gains are either set by the camera device
432 * when the request {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not
433 * TRANSFORM_MATRIX, or directly by the application in the
434 * request when the {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is
435 * TRANSFORM_MATRIX.</p>
436 * <p>The gains in the result metadata are the gains actually
437 * applied by the camera device to the current frame.</p>
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -0800438 * <p>The valid range of gains varies on different devices, but gains
439 * between [1.0, 3.0] are guaranteed not to be clipped. Even if a given
440 * device allows gains below 1.0, this is usually not recommended because
441 * this can create color artifacts.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700442 * <p><b>Units</b>: Unitless gain factors</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700443 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
444 * <p><b>Full capability</b> -
445 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
446 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800447 *
448 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700449 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700450 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700451 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700452 public static final Key<android.hardware.camera2.params.RggbChannelVector> COLOR_CORRECTION_GAINS =
453 new Key<android.hardware.camera2.params.RggbChannelVector>("android.colorCorrection.gains", android.hardware.camera2.params.RggbChannelVector.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700454
455 /**
Zhijun Hea05e59d2014-07-08 18:27:47 -0700456 * <p>Mode of operation for the chromatic aberration correction algorithm.</p>
Zhijun Hea05e59d2014-07-08 18:27:47 -0700457 * <p>Chromatic (color) aberration is caused by the fact that different wavelengths of light
458 * can not focus on the same point after exiting from the lens. This metadata defines
459 * the high level control of chromatic aberration correction algorithm, which aims to
460 * minimize the chromatic artifacts that may occur along the object boundaries in an
461 * image.</p>
462 * <p>FAST/HIGH_QUALITY both mean that camera device determined aberration
463 * correction will be applied. HIGH_QUALITY mode indicates that the camera device will
464 * use the highest-quality aberration correction algorithms, even if it slows down
465 * capture rate. FAST means the camera device will not slow down capture rate when
466 * applying aberration correction.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700467 * <p>LEGACY devices will always be in FAST mode.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700468 * <p><b>Possible values:</b>
469 * <ul>
470 * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_OFF OFF}</li>
471 * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_FAST FAST}</li>
472 * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
473 * </ul></p>
474 * <p><b>Available values for this device:</b><br>
475 * {@link CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES android.colorCorrection.availableAberrationModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700476 * <p>This key is available on all devices.</p>
Zhijun Hea05e59d2014-07-08 18:27:47 -0700477 *
Zhijun He9e4e4392014-08-18 11:12:32 -0700478 * @see CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES
479 * @see #COLOR_CORRECTION_ABERRATION_MODE_OFF
480 * @see #COLOR_CORRECTION_ABERRATION_MODE_FAST
481 * @see #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY
Zhijun Hea05e59d2014-07-08 18:27:47 -0700482 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700483 @PublicKey
Zhijun He9e4e4392014-08-18 11:12:32 -0700484 public static final Key<Integer> COLOR_CORRECTION_ABERRATION_MODE =
485 new Key<Integer>("android.colorCorrection.aberrationMode", int.class);
Zhijun Hea05e59d2014-07-08 18:27:47 -0700486
487 /**
Zhijun He379af012014-05-06 11:54:54 -0700488 * <p>The desired setting for the camera device's auto-exposure
489 * algorithm's antibanding compensation.</p>
490 * <p>Some kinds of lighting fixtures, such as some fluorescent
491 * lights, flicker at the rate of the power supply frequency
492 * (60Hz or 50Hz, depending on country). While this is
493 * typically not noticeable to a person, it can be visible to
494 * a camera device. If a camera sets its exposure time to the
495 * wrong value, the flicker may become visible in the
496 * viewfinder as flicker or in a final captured image, as a
497 * set of variable-brightness bands across the image.</p>
498 * <p>Therefore, the auto-exposure routines of camera devices
499 * include antibanding routines that ensure that the chosen
500 * exposure value will not cause such banding. The choice of
501 * exposure time depends on the rate of flicker, which the
502 * camera device can detect automatically, or the expected
503 * rate can be selected by the application using this
504 * control.</p>
505 * <p>A given camera device may not support all of the possible
506 * options for the antibanding mode. The
507 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes} key contains
508 * the available modes for a given camera device.</p>
Yin-Chia Yeh7b2cae62014-11-25 11:54:18 -0800509 * <p>AUTO mode is the default if it is available on given
510 * camera device. When AUTO mode is not available, the
511 * default will be either 50HZ or 60HZ, and both 50HZ
512 * and 60HZ will be available.</p>
Zhijun He379af012014-05-06 11:54:54 -0700513 * <p>If manual exposure control is enabled (by setting
514 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} to OFF),
515 * then this setting has no effect, and the application must
516 * ensure it selects exposure times that do not cause banding
517 * issues. The {@link CaptureResult#STATISTICS_SCENE_FLICKER android.statistics.sceneFlicker} key can assist
518 * the application in this.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700519 * <p><b>Possible values:</b>
520 * <ul>
521 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_OFF OFF}</li>
522 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_50HZ 50HZ}</li>
523 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_60HZ 60HZ}</li>
524 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_AUTO AUTO}</li>
525 * </ul></p>
526 * <p><b>Available values for this device:</b><br></p>
527 * <p>{@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700528 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -0700529 *
530 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES
531 * @see CaptureRequest#CONTROL_AE_MODE
532 * @see CaptureRequest#CONTROL_MODE
533 * @see CaptureResult#STATISTICS_SCENE_FLICKER
534 * @see #CONTROL_AE_ANTIBANDING_MODE_OFF
535 * @see #CONTROL_AE_ANTIBANDING_MODE_50HZ
536 * @see #CONTROL_AE_ANTIBANDING_MODE_60HZ
537 * @see #CONTROL_AE_ANTIBANDING_MODE_AUTO
538 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700539 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700540 public static final Key<Integer> CONTROL_AE_ANTIBANDING_MODE =
541 new Key<Integer>("android.control.aeAntibandingMode", int.class);
542
543 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700544 * <p>Adjustment to auto-exposure (AE) target image
545 * brightness.</p>
546 * <p>The adjustment is measured as a count of steps, with the
547 * step size defined by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep} and the
548 * allowed range by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}.</p>
549 * <p>For example, if the exposure value (EV) step is 0.333, '6'
550 * will mean an exposure compensation of +2 EV; -3 will mean an
551 * exposure compensation of -1 EV. One EV represents a doubling
552 * of image brightness. Note that this control will only be
553 * effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF. This control
554 * 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 -0700555 * <p>In the event of exposure compensation value being changed, camera device
556 * may take several frames to reach the newly requested exposure target.
557 * During that time, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} field will be in the SEARCHING
558 * state. Once the new exposure target is reached, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} will
559 * change from SEARCHING to either CONVERGED, LOCKED (if AE lock is enabled), or
560 * FLASH_REQUIRED (if the scene is too dark for still capture).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700561 * <p><b>Units</b>: Compensation steps</p>
562 * <p><b>Range of valid values:</b><br>
563 * {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700564 * <p>This key is available on all devices.</p>
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700565 *
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700566 * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE
567 * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700568 * @see CaptureRequest#CONTROL_AE_LOCK
569 * @see CaptureRequest#CONTROL_AE_MODE
570 * @see CaptureResult#CONTROL_AE_STATE
Zhijun He379af012014-05-06 11:54:54 -0700571 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700572 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700573 public static final Key<Integer> CONTROL_AE_EXPOSURE_COMPENSATION =
574 new Key<Integer>("android.control.aeExposureCompensation", int.class);
575
576 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700577 * <p>Whether auto-exposure (AE) is currently locked to its latest
Zhijun He379af012014-05-06 11:54:54 -0700578 * calculated values.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700579 * <p>When set to <code>true</code> (ON), the AE algorithm is locked to its latest parameters,
580 * and will not change exposure settings until the lock is set to <code>false</code> (OFF).</p>
581 * <p>Note that even when AE is locked, the flash may be fired if
582 * the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_AUTO_FLASH /
583 * ON_ALWAYS_FLASH / ON_AUTO_FLASH_REDEYE.</p>
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700584 * <p>When {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation} is changed, even if the AE lock
585 * is ON, the camera device will still adjust its exposure value.</p>
Zhijun He379af012014-05-06 11:54:54 -0700586 * <p>If AE precapture is triggered (see {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger})
587 * when AE is already locked, the camera device will not change the exposure time
588 * ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}) and sensitivity ({@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity})
589 * parameters. The flash may be fired if the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}
590 * is ON_AUTO_FLASH/ON_AUTO_FLASH_REDEYE and the scene is too dark. If the
Zhijun Hefa95b042015-02-09 10:40:49 -0800591 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_ALWAYS_FLASH, the scene may become overexposed.
592 * Similarly, AE precapture trigger CANCEL has no effect when AE is already locked.</p>
593 * <p>When an AE precapture sequence is triggered, AE unlock will not be able to unlock
594 * the AE if AE is locked by the camera device internally during precapture metering
595 * sequence In other words, submitting requests with AE unlock has no effect for an
596 * ongoing precapture metering sequence. Otherwise, the precapture metering sequence
597 * will never succeed in a sequence of preview requests where AE lock is always set
598 * to <code>false</code>.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700599 * <p>Since the camera device has a pipeline of in-flight requests, the settings that
600 * get locked do not necessarily correspond to the settings that were present in the
601 * latest capture result received from the camera device, since additional captures
602 * and AE updates may have occurred even before the result was sent out. If an
603 * application is switching between automatic and manual control and wishes to eliminate
604 * any flicker during the switch, the following procedure is recommended:</p>
605 * <ol>
606 * <li>Starting in auto-AE mode:</li>
607 * <li>Lock AE</li>
608 * <li>Wait for the first result to be output that has the AE locked</li>
609 * <li>Copy exposure settings from that result into a request, set the request to manual AE</li>
610 * <li>Submit the capture request, proceed to run manual AE as desired.</li>
611 * </ol>
Zhijun He379af012014-05-06 11:54:54 -0700612 * <p>See {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE lock related state transition details.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700613 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -0700614 *
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700615 * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
Zhijun He379af012014-05-06 11:54:54 -0700616 * @see CaptureRequest#CONTROL_AE_MODE
617 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
618 * @see CaptureResult#CONTROL_AE_STATE
619 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
620 * @see CaptureRequest#SENSOR_SENSITIVITY
621 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700622 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700623 public static final Key<Boolean> CONTROL_AE_LOCK =
624 new Key<Boolean>("android.control.aeLock", boolean.class);
625
626 /**
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800627 * <p>The desired mode for the camera device's
628 * auto-exposure routine.</p>
629 * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is
630 * AUTO.</p>
631 * <p>When set to any of the ON modes, the camera device's
632 * auto-exposure routine is enabled, overriding the
633 * application's selected exposure time, sensor sensitivity,
634 * and frame duration ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
635 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and
636 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}). If one of the FLASH modes
637 * is selected, the camera device's flash unit controls are
638 * also overridden.</p>
639 * <p>The FLASH modes are only available if the camera device
640 * has a flash unit ({@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} is <code>true</code>).</p>
641 * <p>If flash TORCH mode is desired, this field must be set to
642 * ON or OFF, and {@link CaptureRequest#FLASH_MODE android.flash.mode} set to TORCH.</p>
643 * <p>When set to any of the ON modes, the values chosen by the
644 * camera device auto-exposure routine for the overridden
645 * fields for a given capture will be available in its
646 * CaptureResult.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700647 * <p><b>Possible values:</b>
648 * <ul>
649 * <li>{@link #CONTROL_AE_MODE_OFF OFF}</li>
650 * <li>{@link #CONTROL_AE_MODE_ON ON}</li>
651 * <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH ON_AUTO_FLASH}</li>
652 * <li>{@link #CONTROL_AE_MODE_ON_ALWAYS_FLASH ON_ALWAYS_FLASH}</li>
653 * <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE ON_AUTO_FLASH_REDEYE}</li>
654 * </ul></p>
655 * <p><b>Available values for this device:</b><br>
656 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES android.control.aeAvailableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700657 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800658 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700659 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES
Zhijun He5f2a47f2014-01-16 15:44:41 -0800660 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800661 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
662 * @see CaptureRequest#FLASH_MODE
Igor Murashkinaef3b7e2014-01-15 13:20:37 -0800663 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
664 * @see CaptureRequest#SENSOR_FRAME_DURATION
Zhijun He399f05d2014-01-15 11:31:30 -0800665 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800666 * @see #CONTROL_AE_MODE_OFF
667 * @see #CONTROL_AE_MODE_ON
668 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH
669 * @see #CONTROL_AE_MODE_ON_ALWAYS_FLASH
670 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE
671 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700672 @PublicKey
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800673 public static final Key<Integer> CONTROL_AE_MODE =
674 new Key<Integer>("android.control.aeMode", int.class);
675
676 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700677 * <p>List of metering areas to use for auto-exposure adjustment.</p>
678 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe} is 0.
Yin-Chia Yeh808150f2014-09-08 15:48:47 -0700679 * Otherwise will always be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700680 * <p>The maximum number of regions supported by the device is determined by the value
681 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe}.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -0800682 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -0700683 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800684 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
685 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -0700686 * bottom-right pixel in the active pixel array.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700687 * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -0700688 * for every pixel in the area. This means that a large metering area
689 * with the same weight as a smaller area will have more effect in
690 * the metering result. Metering areas can partially overlap and the
691 * camera device will add the weights in the overlap region.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700692 * <p>The weights are relative to weights of other exposure metering regions, so if only one
693 * region is used, all non-zero weights will have the same effect. A region with 0
694 * weight is ignored.</p>
695 * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
696 * camera device.</p>
697 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
698 * capture result metadata, the camera device will ignore the sections outside the crop
699 * region and output only the intersection rectangle as the metering region in the result
700 * metadata. If the region is entirely outside the crop region, it will be ignored and
701 * not reported in the result metadata.</p>
702 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
703 * <p><b>Range of valid values:</b><br>
704 * Coordinates must be between <code>[(0,0), (width, height))</code> of
705 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -0700706 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800707 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -0700708 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AE
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800709 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800710 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700711 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700712 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -0700713 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AE_REGIONS =
714 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.aeRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700715
716 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700717 * <p>Range over which the auto-exposure routine can
718 * adjust the capture frame rate to maintain good
719 * exposure.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700720 * <p>Only constrains auto-exposure (AE) algorithm, not
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700721 * manual control of {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime} and
722 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}.</p>
723 * <p><b>Units</b>: Frames per second (FPS)</p>
724 * <p><b>Range of valid values:</b><br>
725 * Any of the entries in {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES android.control.aeAvailableTargetFpsRanges}</p>
726 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -0700727 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700728 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES
Zhijun He379af012014-05-06 11:54:54 -0700729 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700730 * @see CaptureRequest#SENSOR_FRAME_DURATION
Zhijun He379af012014-05-06 11:54:54 -0700731 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700732 @PublicKey
Igor Murashkin78712a82014-05-27 18:32:18 -0700733 public static final Key<android.util.Range<Integer>> CONTROL_AE_TARGET_FPS_RANGE =
734 new Key<android.util.Range<Integer>>("android.control.aeTargetFpsRange", new TypeReference<android.util.Range<Integer>>() {{ }});
Zhijun He379af012014-05-06 11:54:54 -0700735
736 /**
737 * <p>Whether the camera device will trigger a precapture
738 * metering sequence when it processes this request.</p>
739 * <p>This entry is normally set to IDLE, or is not
740 * included at all in the request settings. When included and
Zhijun Hedd72be52015-02-06 13:49:51 -0800741 * set to START, the camera device will trigger the auto-exposure (AE)
Zhijun He379af012014-05-06 11:54:54 -0700742 * precapture metering sequence.</p>
Zhijun Hefa95b042015-02-09 10:40:49 -0800743 * <p>When set to CANCEL, the camera device will cancel any active
744 * precapture metering trigger, and return to its initial AE state.
745 * If a precapture metering sequence is already completed, and the camera
746 * device has implicitly locked the AE for subsequent still capture, the
747 * CANCEL trigger will unlock the AE and return to its initial AE state.</p>
Zhijun Hedd72be52015-02-06 13:49:51 -0800748 * <p>The precapture sequence should be triggered before starting a
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700749 * high-quality still capture for final metering decisions to
750 * be made, and for firing pre-capture flash pulses to estimate
751 * scene brightness and required final capture flash power, when
752 * the flash is enabled.</p>
753 * <p>Normally, this entry should be set to START for only a
754 * single request, and the application should wait until the
755 * sequence completes before starting a new one.</p>
Zhijun Hedd72be52015-02-06 13:49:51 -0800756 * <p>When a precapture metering sequence is finished, the camera device
757 * may lock the auto-exposure routine internally to be able to accurately expose the
758 * subsequent still capture image (<code>{@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} == STILL_CAPTURE</code>).
759 * For this case, the AE may not resume normal scan if no subsequent still capture is
760 * submitted. To ensure that the AE routine restarts normal scan, the application should
761 * submit a request with <code>{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} == true</code>, followed by a request
762 * with <code>{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} == false</code>, if the application decides not to submit a
Zhijun Hefa95b042015-02-09 10:40:49 -0800763 * still capture request after the precapture sequence completes. Alternatively, for
764 * API level 23 or newer devices, the CANCEL can be used to unlock the camera device
765 * internally locked AE if the application doesn't submit a still capture request after
766 * the AE precapture trigger. Note that, the CANCEL was added in API level 23, and must not
767 * be used in devices that have earlier API levels.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700768 * <p>The exact effect of auto-exposure (AE) precapture trigger
769 * depends on the current AE mode and state; see
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700770 * {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE precapture state transition
771 * details.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700772 * <p>On LEGACY-level devices, the precapture trigger is not supported;
773 * capturing a high-resolution JPEG image will automatically trigger a
774 * precapture sequence before the high-resolution capture, including
775 * potentially firing a pre-capture flash.</p>
776 * <p><b>Possible values:</b>
777 * <ul>
778 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE IDLE}</li>
779 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_START START}</li>
Zhijun Hefa95b042015-02-09 10:40:49 -0800780 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL CANCEL}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700781 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700782 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
783 * <p><b>Limited capability</b> -
784 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
785 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He379af012014-05-06 11:54:54 -0700786 *
Zhijun Hedd72be52015-02-06 13:49:51 -0800787 * @see CaptureRequest#CONTROL_AE_LOCK
Zhijun He379af012014-05-06 11:54:54 -0700788 * @see CaptureResult#CONTROL_AE_STATE
Zhijun Hedd72be52015-02-06 13:49:51 -0800789 * @see CaptureRequest#CONTROL_CAPTURE_INTENT
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700790 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He379af012014-05-06 11:54:54 -0700791 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE
792 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_START
Zhijun Hefa95b042015-02-09 10:40:49 -0800793 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL
Zhijun He379af012014-05-06 11:54:54 -0700794 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700795 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700796 public static final Key<Integer> CONTROL_AE_PRECAPTURE_TRIGGER =
797 new Key<Integer>("android.control.aePrecaptureTrigger", int.class);
798
799 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700800 * <p>Current state of the auto-exposure (AE) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -0800801 * <p>Switching between or enabling AE modes ({@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}) always
802 * resets the AE state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
803 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
804 * the algorithm states to INACTIVE.</p>
805 * <p>The camera device can do several state transitions between two results, if it is
806 * allowed by the state transition table. For example: INACTIVE may never actually be
807 * seen in a result.</p>
808 * <p>The state in the result is the state for this image (in sync with this image): if
809 * AE state becomes CONVERGED, then the image data associated with this result should
810 * be good to use.</p>
811 * <p>Below are state transition tables for different AE modes.</p>
812 * <table>
813 * <thead>
814 * <tr>
815 * <th align="center">State</th>
816 * <th align="center">Transition Cause</th>
817 * <th align="center">New State</th>
818 * <th align="center">Notes</th>
819 * </tr>
820 * </thead>
821 * <tbody>
822 * <tr>
823 * <td align="center">INACTIVE</td>
824 * <td align="center"></td>
825 * <td align="center">INACTIVE</td>
826 * <td align="center">Camera device auto exposure algorithm is disabled</td>
827 * </tr>
828 * </tbody>
829 * </table>
830 * <p>When {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is AE_MODE_ON_*:</p>
831 * <table>
832 * <thead>
833 * <tr>
834 * <th align="center">State</th>
835 * <th align="center">Transition Cause</th>
836 * <th align="center">New State</th>
837 * <th align="center">Notes</th>
838 * </tr>
839 * </thead>
840 * <tbody>
841 * <tr>
842 * <td align="center">INACTIVE</td>
843 * <td align="center">Camera device initiates AE scan</td>
844 * <td align="center">SEARCHING</td>
845 * <td align="center">Values changing</td>
846 * </tr>
847 * <tr>
848 * <td align="center">INACTIVE</td>
849 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
850 * <td align="center">LOCKED</td>
851 * <td align="center">Values locked</td>
852 * </tr>
853 * <tr>
854 * <td align="center">SEARCHING</td>
855 * <td align="center">Camera device finishes AE scan</td>
856 * <td align="center">CONVERGED</td>
857 * <td align="center">Good values, not changing</td>
858 * </tr>
859 * <tr>
860 * <td align="center">SEARCHING</td>
861 * <td align="center">Camera device finishes AE scan</td>
862 * <td align="center">FLASH_REQUIRED</td>
863 * <td align="center">Converged but too dark w/o flash</td>
864 * </tr>
865 * <tr>
866 * <td align="center">SEARCHING</td>
867 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
868 * <td align="center">LOCKED</td>
869 * <td align="center">Values locked</td>
870 * </tr>
871 * <tr>
872 * <td align="center">CONVERGED</td>
873 * <td align="center">Camera device initiates AE scan</td>
874 * <td align="center">SEARCHING</td>
875 * <td align="center">Values changing</td>
876 * </tr>
877 * <tr>
878 * <td align="center">CONVERGED</td>
879 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
880 * <td align="center">LOCKED</td>
881 * <td align="center">Values locked</td>
882 * </tr>
883 * <tr>
884 * <td align="center">FLASH_REQUIRED</td>
885 * <td align="center">Camera device initiates AE scan</td>
886 * <td align="center">SEARCHING</td>
887 * <td align="center">Values changing</td>
888 * </tr>
889 * <tr>
890 * <td align="center">FLASH_REQUIRED</td>
891 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
892 * <td align="center">LOCKED</td>
893 * <td align="center">Values locked</td>
894 * </tr>
895 * <tr>
896 * <td align="center">LOCKED</td>
897 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
898 * <td align="center">SEARCHING</td>
899 * <td align="center">Values not good after unlock</td>
900 * </tr>
901 * <tr>
902 * <td align="center">LOCKED</td>
903 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
904 * <td align="center">CONVERGED</td>
905 * <td align="center">Values good after unlock</td>
906 * </tr>
907 * <tr>
908 * <td align="center">LOCKED</td>
909 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
910 * <td align="center">FLASH_REQUIRED</td>
911 * <td align="center">Exposure good, but too dark</td>
912 * </tr>
913 * <tr>
914 * <td align="center">PRECAPTURE</td>
915 * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
916 * <td align="center">CONVERGED</td>
917 * <td align="center">Ready for high-quality capture</td>
918 * </tr>
919 * <tr>
920 * <td align="center">PRECAPTURE</td>
921 * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
922 * <td align="center">LOCKED</td>
923 * <td align="center">Ready for high-quality capture</td>
924 * </tr>
925 * <tr>
Zhijun Hefa95b042015-02-09 10:40:49 -0800926 * <td align="center">LOCKED</td>
927 * <td align="center">aeLock is ON and aePrecaptureTrigger is START</td>
928 * <td align="center">LOCKED</td>
929 * <td align="center">Precapture trigger is ignored when AE is already locked</td>
930 * </tr>
931 * <tr>
932 * <td align="center">LOCKED</td>
933 * <td align="center">aeLock is ON and aePrecaptureTrigger is CANCEL</td>
934 * <td align="center">LOCKED</td>
935 * <td align="center">Precapture trigger is ignored when AE is already locked</td>
936 * </tr>
937 * <tr>
938 * <td align="center">Any state (excluding LOCKED)</td>
Zhijun He228f4f92014-01-16 17:22:05 -0800939 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START</td>
940 * <td align="center">PRECAPTURE</td>
941 * <td align="center">Start AE precapture metering sequence</td>
942 * </tr>
Zhijun Hefa95b042015-02-09 10:40:49 -0800943 * <tr>
944 * <td align="center">Any state (excluding LOCKED)</td>
945 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is CANCEL</td>
946 * <td align="center">INACTIVE</td>
947 * <td align="center">Currently active precapture metering sequence is canceled</td>
948 * </tr>
Zhijun He228f4f92014-01-16 17:22:05 -0800949 * </tbody>
950 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -0800951 * <p>For the above table, the camera device may skip reporting any state changes that happen
952 * without application intervention (i.e. mode switch, trigger, locking). Any state that
953 * can be skipped in that manner is called a transient state.</p>
954 * <p>For example, for above AE modes (AE_MODE_ON_*), in addition to the state transitions
955 * listed in above table, it is also legal for the camera device to skip one or more
956 * transient states between two results. See below table for examples:</p>
957 * <table>
958 * <thead>
959 * <tr>
960 * <th align="center">State</th>
961 * <th align="center">Transition Cause</th>
962 * <th align="center">New State</th>
963 * <th align="center">Notes</th>
964 * </tr>
965 * </thead>
966 * <tbody>
967 * <tr>
968 * <td align="center">INACTIVE</td>
969 * <td align="center">Camera device finished AE scan</td>
970 * <td align="center">CONVERGED</td>
971 * <td align="center">Values are already good, transient states are skipped by camera device.</td>
972 * </tr>
973 * <tr>
Zhijun Hefa95b042015-02-09 10:40:49 -0800974 * <td align="center">Any state (excluding LOCKED)</td>
Zhijun He60b19dc2014-02-24 10:19:20 -0800975 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td>
976 * <td align="center">FLASH_REQUIRED</td>
977 * <td align="center">Converged but too dark w/o flash after a precapture sequence, transient states are skipped by camera device.</td>
978 * </tr>
979 * <tr>
Zhijun Hefa95b042015-02-09 10:40:49 -0800980 * <td align="center">Any state (excluding LOCKED)</td>
Zhijun He60b19dc2014-02-24 10:19:20 -0800981 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td>
982 * <td align="center">CONVERGED</td>
983 * <td align="center">Converged after a precapture sequence, transient states are skipped by camera device.</td>
984 * </tr>
985 * <tr>
Zhijun Hefa95b042015-02-09 10:40:49 -0800986 * <td align="center">Any state (excluding LOCKED)</td>
987 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is CANCEL, converged</td>
988 * <td align="center">FLASH_REQUIRED</td>
989 * <td align="center">Converged but too dark w/o flash after a precapture sequence is canceled, transient states are skipped by camera device.</td>
990 * </tr>
991 * <tr>
992 * <td align="center">Any state (excluding LOCKED)</td>
993 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is CANCEL, converged</td>
994 * <td align="center">CONVERGED</td>
995 * <td align="center">Converged after a precapture sequenceis canceled, transient states are skipped by camera device.</td>
996 * </tr>
997 * <tr>
Zhijun He60b19dc2014-02-24 10:19:20 -0800998 * <td align="center">CONVERGED</td>
999 * <td align="center">Camera device finished AE scan</td>
1000 * <td align="center">FLASH_REQUIRED</td>
1001 * <td align="center">Converged but too dark w/o flash after a new scan, transient states are skipped by camera device.</td>
1002 * </tr>
1003 * <tr>
1004 * <td align="center">FLASH_REQUIRED</td>
1005 * <td align="center">Camera device finished AE scan</td>
1006 * <td align="center">CONVERGED</td>
1007 * <td align="center">Converged after a new scan, transient states are skipped by camera device.</td>
1008 * </tr>
1009 * </tbody>
1010 * </table>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001011 * <p><b>Possible values:</b>
1012 * <ul>
1013 * <li>{@link #CONTROL_AE_STATE_INACTIVE INACTIVE}</li>
1014 * <li>{@link #CONTROL_AE_STATE_SEARCHING SEARCHING}</li>
1015 * <li>{@link #CONTROL_AE_STATE_CONVERGED CONVERGED}</li>
1016 * <li>{@link #CONTROL_AE_STATE_LOCKED LOCKED}</li>
1017 * <li>{@link #CONTROL_AE_STATE_FLASH_REQUIRED FLASH_REQUIRED}</li>
1018 * <li>{@link #CONTROL_AE_STATE_PRECAPTURE PRECAPTURE}</li>
1019 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001020 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1021 * <p><b>Limited capability</b> -
1022 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1023 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001024 *
1025 * @see CaptureRequest#CONTROL_AE_LOCK
1026 * @see CaptureRequest#CONTROL_AE_MODE
1027 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
1028 * @see CaptureRequest#CONTROL_MODE
1029 * @see CaptureRequest#CONTROL_SCENE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001030 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001031 * @see #CONTROL_AE_STATE_INACTIVE
1032 * @see #CONTROL_AE_STATE_SEARCHING
1033 * @see #CONTROL_AE_STATE_CONVERGED
1034 * @see #CONTROL_AE_STATE_LOCKED
1035 * @see #CONTROL_AE_STATE_FLASH_REQUIRED
1036 * @see #CONTROL_AE_STATE_PRECAPTURE
1037 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001038 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001039 public static final Key<Integer> CONTROL_AE_STATE =
1040 new Key<Integer>("android.control.aeState", int.class);
1041
1042 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001043 * <p>Whether auto-focus (AF) is currently enabled, and what
1044 * mode it is set to.</p>
Zhijun Hecc28a412014-02-24 15:11:23 -08001045 * <p>Only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} = AUTO and the lens is not fixed focus
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001046 * (i.e. <code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} &gt; 0</code>). Also note that
1047 * when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF, the behavior of AF is device
1048 * dependent. It is recommended to lock AF by using {@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger} before
1049 * setting {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} to OFF, or set AF mode to OFF when AE is OFF.</p>
Zhijun He78146ec2014-01-14 18:12:13 -08001050 * <p>If the lens is controlled by the camera device auto-focus algorithm,
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001051 * the camera device will report the current AF status in {@link CaptureResult#CONTROL_AF_STATE android.control.afState}
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001052 * in result metadata.</p>
1053 * <p><b>Possible values:</b>
1054 * <ul>
1055 * <li>{@link #CONTROL_AF_MODE_OFF OFF}</li>
1056 * <li>{@link #CONTROL_AF_MODE_AUTO AUTO}</li>
1057 * <li>{@link #CONTROL_AF_MODE_MACRO MACRO}</li>
1058 * <li>{@link #CONTROL_AF_MODE_CONTINUOUS_VIDEO CONTINUOUS_VIDEO}</li>
1059 * <li>{@link #CONTROL_AF_MODE_CONTINUOUS_PICTURE CONTINUOUS_PICTURE}</li>
1060 * <li>{@link #CONTROL_AF_MODE_EDOF EDOF}</li>
1061 * </ul></p>
1062 * <p><b>Available values for this device:</b><br>
1063 * {@link CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES android.control.afAvailableModes}</p>
1064 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001065 *
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001066 * @see CaptureRequest#CONTROL_AE_MODE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001067 * @see CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001068 * @see CaptureResult#CONTROL_AF_STATE
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001069 * @see CaptureRequest#CONTROL_AF_TRIGGER
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001070 * @see CaptureRequest#CONTROL_MODE
Zhijun Hecc28a412014-02-24 15:11:23 -08001071 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001072 * @see #CONTROL_AF_MODE_OFF
1073 * @see #CONTROL_AF_MODE_AUTO
1074 * @see #CONTROL_AF_MODE_MACRO
1075 * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO
1076 * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE
1077 * @see #CONTROL_AF_MODE_EDOF
1078 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001079 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001080 public static final Key<Integer> CONTROL_AF_MODE =
1081 new Key<Integer>("android.control.afMode", int.class);
1082
1083 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001084 * <p>List of metering areas to use for auto-focus.</p>
1085 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf} is 0.
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001086 * Otherwise will always be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001087 * <p>The maximum number of focus areas supported by the device is determined by the value
1088 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf}.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001089 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -07001090 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001091 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
1092 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001093 * bottom-right pixel in the active pixel array.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001094 * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001095 * for every pixel in the area. This means that a large metering area
1096 * with the same weight as a smaller area will have more effect in
1097 * the metering result. Metering areas can partially overlap and the
1098 * camera device will add the weights in the overlap region.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001099 * <p>The weights are relative to weights of other metering regions, so if only one region
1100 * is used, all non-zero weights will have the same effect. A region with 0 weight is
1101 * ignored.</p>
1102 * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
1103 * camera device.</p>
1104 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
1105 * capture result metadata, the camera device will ignore the sections outside the crop
1106 * region and output only the intersection rectangle as the metering region in the result
1107 * metadata. If the region is entirely outside the crop region, it will be ignored and
1108 * not reported in the result metadata.</p>
1109 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
1110 * <p><b>Range of valid values:</b><br>
1111 * Coordinates must be between <code>[(0,0), (width, height))</code> of
1112 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001113 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001114 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001115 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AF
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001116 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001117 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001118 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001119 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001120 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AF_REGIONS =
1121 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.afRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001122
1123 /**
Zhijun He379af012014-05-06 11:54:54 -07001124 * <p>Whether the camera device will trigger autofocus for this request.</p>
1125 * <p>This entry is normally set to IDLE, or is not
1126 * included at all in the request settings.</p>
1127 * <p>When included and set to START, the camera device will trigger the
1128 * autofocus algorithm. If autofocus is disabled, this trigger has no effect.</p>
1129 * <p>When set to CANCEL, the camera device will cancel any active trigger,
1130 * and return to its initial AF state.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001131 * <p>Generally, applications should set this entry to START or CANCEL for only a
1132 * single capture, and then return it to IDLE (or not set at all). Specifying
1133 * START for multiple captures in a row means restarting the AF operation over
1134 * and over again.</p>
1135 * <p>See {@link CaptureResult#CONTROL_AF_STATE android.control.afState} for what the trigger means for each AF mode.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001136 * <p><b>Possible values:</b>
1137 * <ul>
1138 * <li>{@link #CONTROL_AF_TRIGGER_IDLE IDLE}</li>
1139 * <li>{@link #CONTROL_AF_TRIGGER_START START}</li>
1140 * <li>{@link #CONTROL_AF_TRIGGER_CANCEL CANCEL}</li>
1141 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001142 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001143 *
1144 * @see CaptureResult#CONTROL_AF_STATE
1145 * @see #CONTROL_AF_TRIGGER_IDLE
1146 * @see #CONTROL_AF_TRIGGER_START
1147 * @see #CONTROL_AF_TRIGGER_CANCEL
1148 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001149 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001150 public static final Key<Integer> CONTROL_AF_TRIGGER =
1151 new Key<Integer>("android.control.afTrigger", int.class);
1152
1153 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001154 * <p>Current state of auto-focus (AF) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001155 * <p>Switching between or enabling AF modes ({@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}) always
1156 * resets the AF state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
1157 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
1158 * the algorithm states to INACTIVE.</p>
1159 * <p>The camera device can do several state transitions between two results, if it is
1160 * allowed by the state transition table. For example: INACTIVE may never actually be
1161 * seen in a result.</p>
1162 * <p>The state in the result is the state for this image (in sync with this image): if
1163 * AF state becomes FOCUSED, then the image data associated with this result should
1164 * be sharp.</p>
1165 * <p>Below are state transition tables for different AF modes.</p>
1166 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_OFF or AF_MODE_EDOF:</p>
1167 * <table>
1168 * <thead>
1169 * <tr>
1170 * <th align="center">State</th>
1171 * <th align="center">Transition Cause</th>
1172 * <th align="center">New State</th>
1173 * <th align="center">Notes</th>
1174 * </tr>
1175 * </thead>
1176 * <tbody>
1177 * <tr>
1178 * <td align="center">INACTIVE</td>
1179 * <td align="center"></td>
1180 * <td align="center">INACTIVE</td>
1181 * <td align="center">Never changes</td>
1182 * </tr>
1183 * </tbody>
1184 * </table>
1185 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_AUTO or AF_MODE_MACRO:</p>
1186 * <table>
1187 * <thead>
1188 * <tr>
1189 * <th align="center">State</th>
1190 * <th align="center">Transition Cause</th>
1191 * <th align="center">New State</th>
1192 * <th align="center">Notes</th>
1193 * </tr>
1194 * </thead>
1195 * <tbody>
1196 * <tr>
1197 * <td align="center">INACTIVE</td>
1198 * <td align="center">AF_TRIGGER</td>
1199 * <td align="center">ACTIVE_SCAN</td>
1200 * <td align="center">Start AF sweep, Lens now moving</td>
1201 * </tr>
1202 * <tr>
1203 * <td align="center">ACTIVE_SCAN</td>
1204 * <td align="center">AF sweep done</td>
1205 * <td align="center">FOCUSED_LOCKED</td>
1206 * <td align="center">Focused, Lens now locked</td>
1207 * </tr>
1208 * <tr>
1209 * <td align="center">ACTIVE_SCAN</td>
1210 * <td align="center">AF sweep done</td>
1211 * <td align="center">NOT_FOCUSED_LOCKED</td>
1212 * <td align="center">Not focused, Lens now locked</td>
1213 * </tr>
1214 * <tr>
1215 * <td align="center">ACTIVE_SCAN</td>
1216 * <td align="center">AF_CANCEL</td>
1217 * <td align="center">INACTIVE</td>
1218 * <td align="center">Cancel/reset AF, Lens now locked</td>
1219 * </tr>
1220 * <tr>
1221 * <td align="center">FOCUSED_LOCKED</td>
1222 * <td align="center">AF_CANCEL</td>
1223 * <td align="center">INACTIVE</td>
1224 * <td align="center">Cancel/reset AF</td>
1225 * </tr>
1226 * <tr>
1227 * <td align="center">FOCUSED_LOCKED</td>
1228 * <td align="center">AF_TRIGGER</td>
1229 * <td align="center">ACTIVE_SCAN</td>
1230 * <td align="center">Start new sweep, Lens now moving</td>
1231 * </tr>
1232 * <tr>
1233 * <td align="center">NOT_FOCUSED_LOCKED</td>
1234 * <td align="center">AF_CANCEL</td>
1235 * <td align="center">INACTIVE</td>
1236 * <td align="center">Cancel/reset AF</td>
1237 * </tr>
1238 * <tr>
1239 * <td align="center">NOT_FOCUSED_LOCKED</td>
1240 * <td align="center">AF_TRIGGER</td>
1241 * <td align="center">ACTIVE_SCAN</td>
1242 * <td align="center">Start new sweep, Lens now moving</td>
1243 * </tr>
1244 * <tr>
1245 * <td align="center">Any state</td>
1246 * <td align="center">Mode change</td>
1247 * <td align="center">INACTIVE</td>
1248 * <td align="center"></td>
1249 * </tr>
1250 * </tbody>
1251 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -08001252 * <p>For the above table, the camera device may skip reporting any state changes that happen
1253 * without application intervention (i.e. mode switch, trigger, locking). Any state that
1254 * can be skipped in that manner is called a transient state.</p>
1255 * <p>For example, for these AF modes (AF_MODE_AUTO and AF_MODE_MACRO), in addition to the
1256 * state transitions listed in above table, it is also legal for the camera device to skip
1257 * one or more transient states between two results. See below table for examples:</p>
1258 * <table>
1259 * <thead>
1260 * <tr>
1261 * <th align="center">State</th>
1262 * <th align="center">Transition Cause</th>
1263 * <th align="center">New State</th>
1264 * <th align="center">Notes</th>
1265 * </tr>
1266 * </thead>
1267 * <tbody>
1268 * <tr>
1269 * <td align="center">INACTIVE</td>
1270 * <td align="center">AF_TRIGGER</td>
1271 * <td align="center">FOCUSED_LOCKED</td>
1272 * <td align="center">Focus is already good or good after a scan, lens is now locked.</td>
1273 * </tr>
1274 * <tr>
1275 * <td align="center">INACTIVE</td>
1276 * <td align="center">AF_TRIGGER</td>
1277 * <td align="center">NOT_FOCUSED_LOCKED</td>
1278 * <td align="center">Focus failed after a scan, lens is now locked.</td>
1279 * </tr>
1280 * <tr>
1281 * <td align="center">FOCUSED_LOCKED</td>
1282 * <td align="center">AF_TRIGGER</td>
1283 * <td align="center">FOCUSED_LOCKED</td>
1284 * <td align="center">Focus is already good or good after a scan, lens is now locked.</td>
1285 * </tr>
1286 * <tr>
1287 * <td align="center">NOT_FOCUSED_LOCKED</td>
1288 * <td align="center">AF_TRIGGER</td>
1289 * <td align="center">FOCUSED_LOCKED</td>
1290 * <td align="center">Focus is good after a scan, lens is not locked.</td>
1291 * </tr>
1292 * </tbody>
1293 * </table>
Zhijun He228f4f92014-01-16 17:22:05 -08001294 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_VIDEO:</p>
1295 * <table>
1296 * <thead>
1297 * <tr>
1298 * <th align="center">State</th>
1299 * <th align="center">Transition Cause</th>
1300 * <th align="center">New State</th>
1301 * <th align="center">Notes</th>
1302 * </tr>
1303 * </thead>
1304 * <tbody>
1305 * <tr>
1306 * <td align="center">INACTIVE</td>
1307 * <td align="center">Camera device initiates new scan</td>
1308 * <td align="center">PASSIVE_SCAN</td>
1309 * <td align="center">Start AF scan, Lens now moving</td>
1310 * </tr>
1311 * <tr>
1312 * <td align="center">INACTIVE</td>
1313 * <td align="center">AF_TRIGGER</td>
1314 * <td align="center">NOT_FOCUSED_LOCKED</td>
1315 * <td align="center">AF state query, Lens now locked</td>
1316 * </tr>
1317 * <tr>
1318 * <td align="center">PASSIVE_SCAN</td>
1319 * <td align="center">Camera device completes current scan</td>
1320 * <td align="center">PASSIVE_FOCUSED</td>
1321 * <td align="center">End AF scan, Lens now locked</td>
1322 * </tr>
1323 * <tr>
1324 * <td align="center">PASSIVE_SCAN</td>
1325 * <td align="center">Camera device fails current scan</td>
1326 * <td align="center">PASSIVE_UNFOCUSED</td>
1327 * <td align="center">End AF scan, Lens now locked</td>
1328 * </tr>
1329 * <tr>
1330 * <td align="center">PASSIVE_SCAN</td>
1331 * <td align="center">AF_TRIGGER</td>
1332 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001333 * <td align="center">Immediate transition, if focus is good. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001334 * </tr>
1335 * <tr>
1336 * <td align="center">PASSIVE_SCAN</td>
1337 * <td align="center">AF_TRIGGER</td>
1338 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001339 * <td align="center">Immediate transition, if focus is bad. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001340 * </tr>
1341 * <tr>
1342 * <td align="center">PASSIVE_SCAN</td>
1343 * <td align="center">AF_CANCEL</td>
1344 * <td align="center">INACTIVE</td>
1345 * <td align="center">Reset lens position, Lens now locked</td>
1346 * </tr>
1347 * <tr>
1348 * <td align="center">PASSIVE_FOCUSED</td>
1349 * <td align="center">Camera device initiates new scan</td>
1350 * <td align="center">PASSIVE_SCAN</td>
1351 * <td align="center">Start AF scan, Lens now moving</td>
1352 * </tr>
1353 * <tr>
1354 * <td align="center">PASSIVE_UNFOCUSED</td>
1355 * <td align="center">Camera device initiates new scan</td>
1356 * <td align="center">PASSIVE_SCAN</td>
1357 * <td align="center">Start AF scan, Lens now moving</td>
1358 * </tr>
1359 * <tr>
1360 * <td align="center">PASSIVE_FOCUSED</td>
1361 * <td align="center">AF_TRIGGER</td>
1362 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001363 * <td align="center">Immediate transition, lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001364 * </tr>
1365 * <tr>
1366 * <td align="center">PASSIVE_UNFOCUSED</td>
1367 * <td align="center">AF_TRIGGER</td>
1368 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001369 * <td align="center">Immediate transition, lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001370 * </tr>
1371 * <tr>
1372 * <td align="center">FOCUSED_LOCKED</td>
1373 * <td align="center">AF_TRIGGER</td>
1374 * <td align="center">FOCUSED_LOCKED</td>
1375 * <td align="center">No effect</td>
1376 * </tr>
1377 * <tr>
1378 * <td align="center">FOCUSED_LOCKED</td>
1379 * <td align="center">AF_CANCEL</td>
1380 * <td align="center">INACTIVE</td>
1381 * <td align="center">Restart AF scan</td>
1382 * </tr>
1383 * <tr>
1384 * <td align="center">NOT_FOCUSED_LOCKED</td>
1385 * <td align="center">AF_TRIGGER</td>
1386 * <td align="center">NOT_FOCUSED_LOCKED</td>
1387 * <td align="center">No effect</td>
1388 * </tr>
1389 * <tr>
1390 * <td align="center">NOT_FOCUSED_LOCKED</td>
1391 * <td align="center">AF_CANCEL</td>
1392 * <td align="center">INACTIVE</td>
1393 * <td align="center">Restart AF scan</td>
1394 * </tr>
1395 * </tbody>
1396 * </table>
1397 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_PICTURE:</p>
1398 * <table>
1399 * <thead>
1400 * <tr>
1401 * <th align="center">State</th>
1402 * <th align="center">Transition Cause</th>
1403 * <th align="center">New State</th>
1404 * <th align="center">Notes</th>
1405 * </tr>
1406 * </thead>
1407 * <tbody>
1408 * <tr>
1409 * <td align="center">INACTIVE</td>
1410 * <td align="center">Camera device initiates new scan</td>
1411 * <td align="center">PASSIVE_SCAN</td>
1412 * <td align="center">Start AF scan, Lens now moving</td>
1413 * </tr>
1414 * <tr>
1415 * <td align="center">INACTIVE</td>
1416 * <td align="center">AF_TRIGGER</td>
1417 * <td align="center">NOT_FOCUSED_LOCKED</td>
1418 * <td align="center">AF state query, Lens now locked</td>
1419 * </tr>
1420 * <tr>
1421 * <td align="center">PASSIVE_SCAN</td>
1422 * <td align="center">Camera device completes current scan</td>
1423 * <td align="center">PASSIVE_FOCUSED</td>
1424 * <td align="center">End AF scan, Lens now locked</td>
1425 * </tr>
1426 * <tr>
1427 * <td align="center">PASSIVE_SCAN</td>
1428 * <td align="center">Camera device fails current scan</td>
1429 * <td align="center">PASSIVE_UNFOCUSED</td>
1430 * <td align="center">End AF scan, Lens now locked</td>
1431 * </tr>
1432 * <tr>
1433 * <td align="center">PASSIVE_SCAN</td>
1434 * <td align="center">AF_TRIGGER</td>
1435 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001436 * <td align="center">Eventual transition once the focus is good. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001437 * </tr>
1438 * <tr>
1439 * <td align="center">PASSIVE_SCAN</td>
1440 * <td align="center">AF_TRIGGER</td>
1441 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001442 * <td align="center">Eventual transition if cannot find focus. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001443 * </tr>
1444 * <tr>
1445 * <td align="center">PASSIVE_SCAN</td>
1446 * <td align="center">AF_CANCEL</td>
1447 * <td align="center">INACTIVE</td>
1448 * <td align="center">Reset lens position, Lens now locked</td>
1449 * </tr>
1450 * <tr>
1451 * <td align="center">PASSIVE_FOCUSED</td>
1452 * <td align="center">Camera device initiates new scan</td>
1453 * <td align="center">PASSIVE_SCAN</td>
1454 * <td align="center">Start AF scan, Lens now moving</td>
1455 * </tr>
1456 * <tr>
1457 * <td align="center">PASSIVE_UNFOCUSED</td>
1458 * <td align="center">Camera device initiates new scan</td>
1459 * <td align="center">PASSIVE_SCAN</td>
1460 * <td align="center">Start AF scan, Lens now moving</td>
1461 * </tr>
1462 * <tr>
1463 * <td align="center">PASSIVE_FOCUSED</td>
1464 * <td align="center">AF_TRIGGER</td>
1465 * <td align="center">FOCUSED_LOCKED</td>
1466 * <td align="center">Immediate trans. Lens now locked</td>
1467 * </tr>
1468 * <tr>
1469 * <td align="center">PASSIVE_UNFOCUSED</td>
1470 * <td align="center">AF_TRIGGER</td>
1471 * <td align="center">NOT_FOCUSED_LOCKED</td>
1472 * <td align="center">Immediate trans. Lens now locked</td>
1473 * </tr>
1474 * <tr>
1475 * <td align="center">FOCUSED_LOCKED</td>
1476 * <td align="center">AF_TRIGGER</td>
1477 * <td align="center">FOCUSED_LOCKED</td>
1478 * <td align="center">No effect</td>
1479 * </tr>
1480 * <tr>
1481 * <td align="center">FOCUSED_LOCKED</td>
1482 * <td align="center">AF_CANCEL</td>
1483 * <td align="center">INACTIVE</td>
1484 * <td align="center">Restart AF scan</td>
1485 * </tr>
1486 * <tr>
1487 * <td align="center">NOT_FOCUSED_LOCKED</td>
1488 * <td align="center">AF_TRIGGER</td>
1489 * <td align="center">NOT_FOCUSED_LOCKED</td>
1490 * <td align="center">No effect</td>
1491 * </tr>
1492 * <tr>
1493 * <td align="center">NOT_FOCUSED_LOCKED</td>
1494 * <td align="center">AF_CANCEL</td>
1495 * <td align="center">INACTIVE</td>
1496 * <td align="center">Restart AF scan</td>
1497 * </tr>
1498 * </tbody>
1499 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -08001500 * <p>When switch between AF_MODE_CONTINUOUS_* (CAF modes) and AF_MODE_AUTO/AF_MODE_MACRO
1501 * (AUTO modes), the initial INACTIVE or PASSIVE_SCAN states may be skipped by the
1502 * camera device. When a trigger is included in a mode switch request, the trigger
1503 * will be evaluated in the context of the new mode in the request.
1504 * See below table for examples:</p>
1505 * <table>
1506 * <thead>
1507 * <tr>
1508 * <th align="center">State</th>
1509 * <th align="center">Transition Cause</th>
1510 * <th align="center">New State</th>
1511 * <th align="center">Notes</th>
1512 * </tr>
1513 * </thead>
1514 * <tbody>
1515 * <tr>
1516 * <td align="center">any state</td>
1517 * <td align="center">CAF--&gt;AUTO mode switch</td>
1518 * <td align="center">INACTIVE</td>
1519 * <td align="center">Mode switch without trigger, initial state must be INACTIVE</td>
1520 * </tr>
1521 * <tr>
1522 * <td align="center">any state</td>
1523 * <td align="center">CAF--&gt;AUTO mode switch with AF_TRIGGER</td>
1524 * <td align="center">trigger-reachable states from INACTIVE</td>
1525 * <td align="center">Mode switch with trigger, INACTIVE is skipped</td>
1526 * </tr>
1527 * <tr>
1528 * <td align="center">any state</td>
1529 * <td align="center">AUTO--&gt;CAF mode switch</td>
1530 * <td align="center">passively reachable states from INACTIVE</td>
1531 * <td align="center">Mode switch without trigger, passive transient state is skipped</td>
1532 * </tr>
1533 * </tbody>
1534 * </table>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001535 * <p><b>Possible values:</b>
1536 * <ul>
1537 * <li>{@link #CONTROL_AF_STATE_INACTIVE INACTIVE}</li>
1538 * <li>{@link #CONTROL_AF_STATE_PASSIVE_SCAN PASSIVE_SCAN}</li>
1539 * <li>{@link #CONTROL_AF_STATE_PASSIVE_FOCUSED PASSIVE_FOCUSED}</li>
1540 * <li>{@link #CONTROL_AF_STATE_ACTIVE_SCAN ACTIVE_SCAN}</li>
1541 * <li>{@link #CONTROL_AF_STATE_FOCUSED_LOCKED FOCUSED_LOCKED}</li>
1542 * <li>{@link #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED NOT_FOCUSED_LOCKED}</li>
1543 * <li>{@link #CONTROL_AF_STATE_PASSIVE_UNFOCUSED PASSIVE_UNFOCUSED}</li>
1544 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001545 * <p>This key is available on all devices.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001546 *
1547 * @see CaptureRequest#CONTROL_AF_MODE
1548 * @see CaptureRequest#CONTROL_MODE
1549 * @see CaptureRequest#CONTROL_SCENE_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001550 * @see #CONTROL_AF_STATE_INACTIVE
1551 * @see #CONTROL_AF_STATE_PASSIVE_SCAN
1552 * @see #CONTROL_AF_STATE_PASSIVE_FOCUSED
1553 * @see #CONTROL_AF_STATE_ACTIVE_SCAN
1554 * @see #CONTROL_AF_STATE_FOCUSED_LOCKED
1555 * @see #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED
Eino-Ville Talvala9f880f72013-09-20 17:50:41 -07001556 * @see #CONTROL_AF_STATE_PASSIVE_UNFOCUSED
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001557 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001558 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001559 public static final Key<Integer> CONTROL_AF_STATE =
1560 new Key<Integer>("android.control.afState", int.class);
1561
1562 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001563 * <p>Whether auto-white balance (AWB) is currently locked to its
Zhijun He379af012014-05-06 11:54:54 -07001564 * latest calculated values.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001565 * <p>When set to <code>true</code> (ON), the AWB algorithm is locked to its latest parameters,
1566 * and will not change color balance settings until the lock is set to <code>false</code> (OFF).</p>
1567 * <p>Since the camera device has a pipeline of in-flight requests, the settings that
1568 * get locked do not necessarily correspond to the settings that were present in the
1569 * latest capture result received from the camera device, since additional captures
1570 * and AWB updates may have occurred even before the result was sent out. If an
1571 * application is switching between automatic and manual control and wishes to eliminate
1572 * any flicker during the switch, the following procedure is recommended:</p>
1573 * <ol>
1574 * <li>Starting in auto-AWB mode:</li>
1575 * <li>Lock AWB</li>
1576 * <li>Wait for the first result to be output that has the AWB locked</li>
1577 * <li>Copy AWB settings from that result into a request, set the request to manual AWB</li>
1578 * <li>Submit the capture request, proceed to run manual AWB as desired.</li>
1579 * </ol>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001580 * <p>Note that AWB lock is only meaningful when
1581 * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is in the AUTO mode; in other modes,
1582 * AWB is already fixed to a specific setting.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001583 * <p>Some LEGACY devices may not support ON; the value is then overridden to OFF.</p>
1584 * <p>This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001585 *
1586 * @see CaptureRequest#CONTROL_AWB_MODE
Zhijun He379af012014-05-06 11:54:54 -07001587 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001588 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001589 public static final Key<Boolean> CONTROL_AWB_LOCK =
1590 new Key<Boolean>("android.control.awbLock", boolean.class);
1591
1592 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001593 * <p>Whether auto-white balance (AWB) is currently setting the color
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001594 * transform fields, and what its illumination target
Zhijun Hecc28a412014-02-24 15:11:23 -08001595 * is.</p>
Zhijun He399f05d2014-01-15 11:31:30 -08001596 * <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 -07001597 * <p>When set to the ON mode, the camera device's auto-white balance
Zhijun He399f05d2014-01-15 11:31:30 -08001598 * routine is enabled, overriding the application's selected
1599 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001600 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}. Note that when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}
1601 * is OFF, the behavior of AWB is device dependent. It is recommened to
1602 * also set AWB mode to OFF or lock AWB by using {@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} before
1603 * setting AE mode to OFF.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001604 * <p>When set to the OFF mode, the camera device's auto-white balance
Zhijun Hecc28a412014-02-24 15:11:23 -08001605 * routine is disabled. The application manually controls the white
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001606 * 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 -08001607 * and {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001608 * <p>When set to any other modes, the camera device's auto-white
1609 * balance routine is disabled. The camera device uses each
1610 * particular illumination target for white balance
1611 * adjustment. The application's values for
1612 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform},
1613 * {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
1614 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} are ignored.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001615 * <p><b>Possible values:</b>
1616 * <ul>
1617 * <li>{@link #CONTROL_AWB_MODE_OFF OFF}</li>
1618 * <li>{@link #CONTROL_AWB_MODE_AUTO AUTO}</li>
1619 * <li>{@link #CONTROL_AWB_MODE_INCANDESCENT INCANDESCENT}</li>
1620 * <li>{@link #CONTROL_AWB_MODE_FLUORESCENT FLUORESCENT}</li>
1621 * <li>{@link #CONTROL_AWB_MODE_WARM_FLUORESCENT WARM_FLUORESCENT}</li>
1622 * <li>{@link #CONTROL_AWB_MODE_DAYLIGHT DAYLIGHT}</li>
1623 * <li>{@link #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT CLOUDY_DAYLIGHT}</li>
1624 * <li>{@link #CONTROL_AWB_MODE_TWILIGHT TWILIGHT}</li>
1625 * <li>{@link #CONTROL_AWB_MODE_SHADE SHADE}</li>
1626 * </ul></p>
1627 * <p><b>Available values for this device:</b><br>
1628 * {@link CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES android.control.awbAvailableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001629 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001630 *
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001631 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Zhijun He5f2a47f2014-01-16 15:44:41 -08001632 * @see CaptureRequest#COLOR_CORRECTION_MODE
1633 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001634 * @see CaptureRequest#CONTROL_AE_MODE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001635 * @see CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001636 * @see CaptureRequest#CONTROL_AWB_LOCK
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001637 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001638 * @see #CONTROL_AWB_MODE_OFF
1639 * @see #CONTROL_AWB_MODE_AUTO
1640 * @see #CONTROL_AWB_MODE_INCANDESCENT
1641 * @see #CONTROL_AWB_MODE_FLUORESCENT
1642 * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT
1643 * @see #CONTROL_AWB_MODE_DAYLIGHT
1644 * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT
1645 * @see #CONTROL_AWB_MODE_TWILIGHT
1646 * @see #CONTROL_AWB_MODE_SHADE
1647 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001648 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001649 public static final Key<Integer> CONTROL_AWB_MODE =
1650 new Key<Integer>("android.control.awbMode", int.class);
1651
1652 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001653 * <p>List of metering areas to use for auto-white-balance illuminant
Ruben Brunkf59521d2014-02-03 17:14:33 -08001654 * estimation.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001655 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb} is 0.
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001656 * Otherwise will always be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001657 * <p>The maximum number of regions supported by the device is determined by the value
1658 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb}.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001659 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -07001660 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001661 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
1662 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001663 * bottom-right pixel in the active pixel array.</p>
1664 * <p>The weight must range from 0 to 1000, and represents a weight
1665 * for every pixel in the area. This means that a large metering area
1666 * with the same weight as a smaller area will have more effect in
1667 * the metering result. Metering areas can partially overlap and the
1668 * camera device will add the weights in the overlap region.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001669 * <p>The weights are relative to weights of other white balance metering regions, so if
1670 * only one region is used, all non-zero weights will have the same effect. A region with
1671 * 0 weight is ignored.</p>
1672 * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
1673 * camera device.</p>
1674 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
1675 * capture result metadata, the camera device will ignore the sections outside the crop
1676 * region and output only the intersection rectangle as the metering region in the result
1677 * metadata. If the region is entirely outside the crop region, it will be ignored and
1678 * not reported in the result metadata.</p>
1679 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
1680 * <p><b>Range of valid values:</b><br>
1681 * Coordinates must be between <code>[(0,0), (width, height))</code> of
1682 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001683 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001684 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001685 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AWB
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001686 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001687 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001688 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001689 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001690 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS =
1691 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.awbRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001692
1693 /**
Zhijun He379af012014-05-06 11:54:54 -07001694 * <p>Information to the camera device 3A (auto-exposure,
1695 * auto-focus, auto-white balance) routines about the purpose
1696 * of this capture, to help the camera device to decide optimal 3A
1697 * strategy.</p>
1698 * <p>This control (except for MANUAL) is only effective if
1699 * <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 -07001700 * <p>ZERO_SHUTTER_LAG will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
Zhijun He0e99c222015-01-29 15:26:05 -08001701 * contains OPAQUE_REPROCESSING. MANUAL will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001702 * contains MANUAL_SENSOR. Other intent values are always supported.</p>
1703 * <p><b>Possible values:</b>
1704 * <ul>
1705 * <li>{@link #CONTROL_CAPTURE_INTENT_CUSTOM CUSTOM}</li>
1706 * <li>{@link #CONTROL_CAPTURE_INTENT_PREVIEW PREVIEW}</li>
1707 * <li>{@link #CONTROL_CAPTURE_INTENT_STILL_CAPTURE STILL_CAPTURE}</li>
1708 * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_RECORD VIDEO_RECORD}</li>
1709 * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT VIDEO_SNAPSHOT}</li>
1710 * <li>{@link #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li>
1711 * <li>{@link #CONTROL_CAPTURE_INTENT_MANUAL MANUAL}</li>
1712 * </ul></p>
1713 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001714 *
1715 * @see CaptureRequest#CONTROL_MODE
1716 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1717 * @see #CONTROL_CAPTURE_INTENT_CUSTOM
1718 * @see #CONTROL_CAPTURE_INTENT_PREVIEW
1719 * @see #CONTROL_CAPTURE_INTENT_STILL_CAPTURE
1720 * @see #CONTROL_CAPTURE_INTENT_VIDEO_RECORD
1721 * @see #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT
1722 * @see #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG
1723 * @see #CONTROL_CAPTURE_INTENT_MANUAL
1724 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001725 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001726 public static final Key<Integer> CONTROL_CAPTURE_INTENT =
1727 new Key<Integer>("android.control.captureIntent", int.class);
1728
1729 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001730 * <p>Current state of auto-white balance (AWB) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001731 * <p>Switching between or enabling AWB modes ({@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}) always
1732 * resets the AWB state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
1733 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
1734 * the algorithm states to INACTIVE.</p>
1735 * <p>The camera device can do several state transitions between two results, if it is
1736 * allowed by the state transition table. So INACTIVE may never actually be seen in
1737 * a result.</p>
1738 * <p>The state in the result is the state for this image (in sync with this image): if
1739 * AWB state becomes CONVERGED, then the image data associated with this result should
1740 * be good to use.</p>
1741 * <p>Below are state transition tables for different AWB modes.</p>
1742 * <p>When <code>{@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} != AWB_MODE_AUTO</code>:</p>
1743 * <table>
1744 * <thead>
1745 * <tr>
1746 * <th align="center">State</th>
1747 * <th align="center">Transition Cause</th>
1748 * <th align="center">New State</th>
1749 * <th align="center">Notes</th>
1750 * </tr>
1751 * </thead>
1752 * <tbody>
1753 * <tr>
1754 * <td align="center">INACTIVE</td>
1755 * <td align="center"></td>
1756 * <td align="center">INACTIVE</td>
1757 * <td align="center">Camera device auto white balance algorithm is disabled</td>
1758 * </tr>
1759 * </tbody>
1760 * </table>
1761 * <p>When {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is AWB_MODE_AUTO:</p>
1762 * <table>
1763 * <thead>
1764 * <tr>
1765 * <th align="center">State</th>
1766 * <th align="center">Transition Cause</th>
1767 * <th align="center">New State</th>
1768 * <th align="center">Notes</th>
1769 * </tr>
1770 * </thead>
1771 * <tbody>
1772 * <tr>
1773 * <td align="center">INACTIVE</td>
1774 * <td align="center">Camera device initiates AWB scan</td>
1775 * <td align="center">SEARCHING</td>
1776 * <td align="center">Values changing</td>
1777 * </tr>
1778 * <tr>
1779 * <td align="center">INACTIVE</td>
1780 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1781 * <td align="center">LOCKED</td>
1782 * <td align="center">Values locked</td>
1783 * </tr>
1784 * <tr>
1785 * <td align="center">SEARCHING</td>
1786 * <td align="center">Camera device finishes AWB scan</td>
1787 * <td align="center">CONVERGED</td>
1788 * <td align="center">Good values, not changing</td>
1789 * </tr>
1790 * <tr>
1791 * <td align="center">SEARCHING</td>
1792 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1793 * <td align="center">LOCKED</td>
1794 * <td align="center">Values locked</td>
1795 * </tr>
1796 * <tr>
1797 * <td align="center">CONVERGED</td>
1798 * <td align="center">Camera device initiates AWB scan</td>
1799 * <td align="center">SEARCHING</td>
1800 * <td align="center">Values changing</td>
1801 * </tr>
1802 * <tr>
1803 * <td align="center">CONVERGED</td>
1804 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1805 * <td align="center">LOCKED</td>
1806 * <td align="center">Values locked</td>
1807 * </tr>
1808 * <tr>
1809 * <td align="center">LOCKED</td>
1810 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
1811 * <td align="center">SEARCHING</td>
1812 * <td align="center">Values not good after unlock</td>
1813 * </tr>
Zhijun He60b19dc2014-02-24 10:19:20 -08001814 * </tbody>
1815 * </table>
1816 * <p>For the above table, the camera device may skip reporting any state changes that happen
1817 * without application intervention (i.e. mode switch, trigger, locking). Any state that
1818 * can be skipped in that manner is called a transient state.</p>
1819 * <p>For example, for this AWB mode (AWB_MODE_AUTO), in addition to the state transitions
1820 * listed in above table, it is also legal for the camera device to skip one or more
1821 * transient states between two results. See below table for examples:</p>
1822 * <table>
1823 * <thead>
1824 * <tr>
1825 * <th align="center">State</th>
1826 * <th align="center">Transition Cause</th>
1827 * <th align="center">New State</th>
1828 * <th align="center">Notes</th>
1829 * </tr>
1830 * </thead>
1831 * <tbody>
1832 * <tr>
1833 * <td align="center">INACTIVE</td>
1834 * <td align="center">Camera device finished AWB scan</td>
1835 * <td align="center">CONVERGED</td>
1836 * <td align="center">Values are already good, transient states are skipped by camera device.</td>
1837 * </tr>
Zhijun He228f4f92014-01-16 17:22:05 -08001838 * <tr>
1839 * <td align="center">LOCKED</td>
1840 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
1841 * <td align="center">CONVERGED</td>
Zhijun He60b19dc2014-02-24 10:19:20 -08001842 * <td align="center">Values good after unlock, transient states are skipped by camera device.</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001843 * </tr>
1844 * </tbody>
1845 * </table>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001846 * <p><b>Possible values:</b>
1847 * <ul>
1848 * <li>{@link #CONTROL_AWB_STATE_INACTIVE INACTIVE}</li>
1849 * <li>{@link #CONTROL_AWB_STATE_SEARCHING SEARCHING}</li>
1850 * <li>{@link #CONTROL_AWB_STATE_CONVERGED CONVERGED}</li>
1851 * <li>{@link #CONTROL_AWB_STATE_LOCKED LOCKED}</li>
1852 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001853 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1854 * <p><b>Limited capability</b> -
1855 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1856 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001857 *
1858 * @see CaptureRequest#CONTROL_AWB_LOCK
1859 * @see CaptureRequest#CONTROL_AWB_MODE
1860 * @see CaptureRequest#CONTROL_MODE
1861 * @see CaptureRequest#CONTROL_SCENE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001862 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001863 * @see #CONTROL_AWB_STATE_INACTIVE
1864 * @see #CONTROL_AWB_STATE_SEARCHING
1865 * @see #CONTROL_AWB_STATE_CONVERGED
1866 * @see #CONTROL_AWB_STATE_LOCKED
1867 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001868 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001869 public static final Key<Integer> CONTROL_AWB_STATE =
1870 new Key<Integer>("android.control.awbState", int.class);
1871
1872 /**
Zhijun He379af012014-05-06 11:54:54 -07001873 * <p>A special color effect to apply.</p>
1874 * <p>When this mode is set, a color effect will be applied
1875 * to images produced by the camera device. The interpretation
1876 * and implementation of these color effects is left to the
1877 * implementor of the camera device, and should not be
1878 * depended on to be consistent (or present) across all
1879 * devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001880 * <p><b>Possible values:</b>
1881 * <ul>
1882 * <li>{@link #CONTROL_EFFECT_MODE_OFF OFF}</li>
1883 * <li>{@link #CONTROL_EFFECT_MODE_MONO MONO}</li>
1884 * <li>{@link #CONTROL_EFFECT_MODE_NEGATIVE NEGATIVE}</li>
1885 * <li>{@link #CONTROL_EFFECT_MODE_SOLARIZE SOLARIZE}</li>
1886 * <li>{@link #CONTROL_EFFECT_MODE_SEPIA SEPIA}</li>
1887 * <li>{@link #CONTROL_EFFECT_MODE_POSTERIZE POSTERIZE}</li>
1888 * <li>{@link #CONTROL_EFFECT_MODE_WHITEBOARD WHITEBOARD}</li>
1889 * <li>{@link #CONTROL_EFFECT_MODE_BLACKBOARD BLACKBOARD}</li>
1890 * <li>{@link #CONTROL_EFFECT_MODE_AQUA AQUA}</li>
1891 * </ul></p>
1892 * <p><b>Available values for this device:</b><br>
1893 * {@link CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS android.control.availableEffects}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001894 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001895 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001896 * @see CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS
Zhijun He379af012014-05-06 11:54:54 -07001897 * @see #CONTROL_EFFECT_MODE_OFF
1898 * @see #CONTROL_EFFECT_MODE_MONO
1899 * @see #CONTROL_EFFECT_MODE_NEGATIVE
1900 * @see #CONTROL_EFFECT_MODE_SOLARIZE
1901 * @see #CONTROL_EFFECT_MODE_SEPIA
1902 * @see #CONTROL_EFFECT_MODE_POSTERIZE
1903 * @see #CONTROL_EFFECT_MODE_WHITEBOARD
1904 * @see #CONTROL_EFFECT_MODE_BLACKBOARD
1905 * @see #CONTROL_EFFECT_MODE_AQUA
1906 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001907 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001908 public static final Key<Integer> CONTROL_EFFECT_MODE =
1909 new Key<Integer>("android.control.effectMode", int.class);
1910
1911 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001912 * <p>Overall mode of 3A (auto-exposure, auto-white-balance, auto-focus) control
Zhijun Hecc28a412014-02-24 15:11:23 -08001913 * routines.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001914 * <p>This is a top-level 3A control switch. When set to OFF, all 3A control
Zhijun He5f2a47f2014-01-16 15:44:41 -08001915 * by the camera device is disabled. The application must set the fields for
Zhijun Hef3537422013-12-16 16:56:35 -08001916 * capture parameters itself.</p>
1917 * <p>When set to AUTO, the individual algorithm controls in
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001918 * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p>
Zhijun Hef3537422013-12-16 16:56:35 -08001919 * <p>When set to USE_SCENE_MODE, the individual controls in
Zhijun He5f2a47f2014-01-16 15:44:41 -08001920 * android.control.* are mostly disabled, and the camera device implements
Zhijun Hef3537422013-12-16 16:56:35 -08001921 * one of the scene mode settings (such as ACTION, SUNSET, or PARTY)
Zhijun He5f2a47f2014-01-16 15:44:41 -08001922 * as it wishes. The camera device scene mode 3A settings are provided by
Zhijun Hef3537422013-12-16 16:56:35 -08001923 * android.control.sceneModeOverrides.</p>
Zhijun He2d5e8972014-02-07 16:13:46 -08001924 * <p>When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference
1925 * is that this frame will not be used by camera device background 3A statistics
1926 * update, as if this frame is never captured. This mode can be used in the scenario
1927 * where the application doesn't want a 3A manual control capture to affect
1928 * the subsequent auto 3A capture results.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001929 * <p><b>Possible values:</b>
1930 * <ul>
1931 * <li>{@link #CONTROL_MODE_OFF OFF}</li>
1932 * <li>{@link #CONTROL_MODE_AUTO AUTO}</li>
1933 * <li>{@link #CONTROL_MODE_USE_SCENE_MODE USE_SCENE_MODE}</li>
1934 * <li>{@link #CONTROL_MODE_OFF_KEEP_STATE OFF_KEEP_STATE}</li>
1935 * </ul></p>
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -08001936 * <p><b>Available values for this device:</b><br>
1937 * {@link CameraCharacteristics#CONTROL_AVAILABLE_MODES android.control.availableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001938 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001939 *
1940 * @see CaptureRequest#CONTROL_AF_MODE
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -08001941 * @see CameraCharacteristics#CONTROL_AVAILABLE_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001942 * @see #CONTROL_MODE_OFF
1943 * @see #CONTROL_MODE_AUTO
1944 * @see #CONTROL_MODE_USE_SCENE_MODE
Zhijun He2d5e8972014-02-07 16:13:46 -08001945 * @see #CONTROL_MODE_OFF_KEEP_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001946 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001947 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001948 public static final Key<Integer> CONTROL_MODE =
1949 new Key<Integer>("android.control.mode", int.class);
1950
1951 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001952 * <p>Control for which scene mode is currently active.</p>
1953 * <p>Scene modes are custom camera modes optimized for a certain set of conditions and
1954 * capture settings.</p>
Zhijun He379af012014-05-06 11:54:54 -07001955 * <p>This is the mode that that is active when
1956 * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code>. Aside from FACE_PRIORITY,
1957 * these modes will disable {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode},
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001958 * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, and {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} while in use.</p>
Zhijun He379af012014-05-06 11:54:54 -07001959 * <p>The interpretation and implementation of these scene modes is left
1960 * to the implementor of the camera device. Their behavior will not be
1961 * consistent across all devices, and any given device may only implement
1962 * a subset of these modes.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001963 * <p><b>Possible values:</b>
1964 * <ul>
1965 * <li>{@link #CONTROL_SCENE_MODE_DISABLED DISABLED}</li>
1966 * <li>{@link #CONTROL_SCENE_MODE_FACE_PRIORITY FACE_PRIORITY}</li>
1967 * <li>{@link #CONTROL_SCENE_MODE_ACTION ACTION}</li>
1968 * <li>{@link #CONTROL_SCENE_MODE_PORTRAIT PORTRAIT}</li>
1969 * <li>{@link #CONTROL_SCENE_MODE_LANDSCAPE LANDSCAPE}</li>
1970 * <li>{@link #CONTROL_SCENE_MODE_NIGHT NIGHT}</li>
1971 * <li>{@link #CONTROL_SCENE_MODE_NIGHT_PORTRAIT NIGHT_PORTRAIT}</li>
1972 * <li>{@link #CONTROL_SCENE_MODE_THEATRE THEATRE}</li>
1973 * <li>{@link #CONTROL_SCENE_MODE_BEACH BEACH}</li>
1974 * <li>{@link #CONTROL_SCENE_MODE_SNOW SNOW}</li>
1975 * <li>{@link #CONTROL_SCENE_MODE_SUNSET SUNSET}</li>
1976 * <li>{@link #CONTROL_SCENE_MODE_STEADYPHOTO STEADYPHOTO}</li>
1977 * <li>{@link #CONTROL_SCENE_MODE_FIREWORKS FIREWORKS}</li>
1978 * <li>{@link #CONTROL_SCENE_MODE_SPORTS SPORTS}</li>
1979 * <li>{@link #CONTROL_SCENE_MODE_PARTY PARTY}</li>
1980 * <li>{@link #CONTROL_SCENE_MODE_CANDLELIGHT CANDLELIGHT}</li>
1981 * <li>{@link #CONTROL_SCENE_MODE_BARCODE BARCODE}</li>
1982 * <li>{@link #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO HIGH_SPEED_VIDEO}</li>
Eino-Ville Talvalaf4eac122014-12-05 11:10:15 -08001983 * <li>{@link #CONTROL_SCENE_MODE_HDR HDR}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001984 * </ul></p>
1985 * <p><b>Available values for this device:</b><br>
1986 * {@link CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES android.control.availableSceneModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001987 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001988 *
1989 * @see CaptureRequest#CONTROL_AE_MODE
1990 * @see CaptureRequest#CONTROL_AF_MODE
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001991 * @see CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES
Zhijun He379af012014-05-06 11:54:54 -07001992 * @see CaptureRequest#CONTROL_AWB_MODE
1993 * @see CaptureRequest#CONTROL_MODE
1994 * @see #CONTROL_SCENE_MODE_DISABLED
1995 * @see #CONTROL_SCENE_MODE_FACE_PRIORITY
1996 * @see #CONTROL_SCENE_MODE_ACTION
1997 * @see #CONTROL_SCENE_MODE_PORTRAIT
1998 * @see #CONTROL_SCENE_MODE_LANDSCAPE
1999 * @see #CONTROL_SCENE_MODE_NIGHT
2000 * @see #CONTROL_SCENE_MODE_NIGHT_PORTRAIT
2001 * @see #CONTROL_SCENE_MODE_THEATRE
2002 * @see #CONTROL_SCENE_MODE_BEACH
2003 * @see #CONTROL_SCENE_MODE_SNOW
2004 * @see #CONTROL_SCENE_MODE_SUNSET
2005 * @see #CONTROL_SCENE_MODE_STEADYPHOTO
2006 * @see #CONTROL_SCENE_MODE_FIREWORKS
2007 * @see #CONTROL_SCENE_MODE_SPORTS
2008 * @see #CONTROL_SCENE_MODE_PARTY
2009 * @see #CONTROL_SCENE_MODE_CANDLELIGHT
2010 * @see #CONTROL_SCENE_MODE_BARCODE
Zhijun Hee0404182014-06-26 13:17:09 -07002011 * @see #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO
Eino-Ville Talvalaf4eac122014-12-05 11:10:15 -08002012 * @see #CONTROL_SCENE_MODE_HDR
Zhijun He379af012014-05-06 11:54:54 -07002013 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002014 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07002015 public static final Key<Integer> CONTROL_SCENE_MODE =
2016 new Key<Integer>("android.control.sceneMode", int.class);
2017
2018 /**
2019 * <p>Whether video stabilization is
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002020 * active.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002021 * <p>Video stabilization automatically translates and scales images from
2022 * the camera in order to stabilize motion between consecutive frames.</p>
Zhijun He379af012014-05-06 11:54:54 -07002023 * <p>If enabled, video stabilization can modify the
Zhijun He45fa43a12014-06-13 18:29:37 -07002024 * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to keep the video stream stabilized.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002025 * <p>Switching between different video stabilization modes may take several
2026 * frames to initialize, the camera device will report the current mode
2027 * in capture result metadata. For example, When "ON" mode is requested,
2028 * the video stabilization modes in the first several capture results may
2029 * still be "OFF", and it will become "ON" when the initialization is
2030 * done.</p>
2031 * <p>If a camera device supports both this mode and OIS
2032 * ({@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}), turning both modes on may
2033 * produce undesirable interaction, so it is recommended not to enable
2034 * both at the same time.</p>
2035 * <p><b>Possible values:</b>
2036 * <ul>
2037 * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_OFF OFF}</li>
2038 * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_ON ON}</li>
2039 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002040 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07002041 *
Zhijun He45fa43a12014-06-13 18:29:37 -07002042 * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
Zhijun He379af012014-05-06 11:54:54 -07002043 * @see CaptureRequest#SCALER_CROP_REGION
2044 * @see #CONTROL_VIDEO_STABILIZATION_MODE_OFF
2045 * @see #CONTROL_VIDEO_STABILIZATION_MODE_ON
2046 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002047 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07002048 public static final Key<Integer> CONTROL_VIDEO_STABILIZATION_MODE =
2049 new Key<Integer>("android.control.videoStabilizationMode", int.class);
2050
2051 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002052 * <p>Operation mode for edge
Zhijun Hecc28a412014-02-24 15:11:23 -08002053 * enhancement.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002054 * <p>Edge enhancement improves sharpness and details in the captured image. OFF means
2055 * no enhancement will be applied by the camera device.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08002056 * <p>FAST/HIGH_QUALITY both mean camera device determined enhancement
Zhijun He28079362013-12-17 10:35:40 -08002057 * will be applied. HIGH_QUALITY mode indicates that the
Zhijun He5f2a47f2014-01-16 15:44:41 -08002058 * camera device will use the highest-quality enhancement algorithms,
2059 * even if it slows down capture rate. FAST means the camera device will
Zhijun He28079362013-12-17 10:35:40 -08002060 * not slow down capture rate when applying edge enhancement.</p>
Zhijun He0e99c222015-01-29 15:26:05 -08002061 * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera
2062 * device will apply FAST/HIGH_QUALITY YUV-domain edge enhancement, respectively.
2063 * The camera device may adjust its internal noise reduction parameters for best
2064 * image quality based on the {@link CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR android.reprocess.effectiveExposureFactor}, if it is set.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002065 * <p><b>Possible values:</b>
2066 * <ul>
2067 * <li>{@link #EDGE_MODE_OFF OFF}</li>
2068 * <li>{@link #EDGE_MODE_FAST FAST}</li>
2069 * <li>{@link #EDGE_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
2070 * </ul></p>
2071 * <p><b>Available values for this device:</b><br>
2072 * {@link CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES android.edge.availableEdgeModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002073 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2074 * <p><b>Full capability</b> -
2075 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2076 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002077 *
2078 * @see CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002079 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He0e99c222015-01-29 15:26:05 -08002080 * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002081 * @see #EDGE_MODE_OFF
2082 * @see #EDGE_MODE_FAST
2083 * @see #EDGE_MODE_HIGH_QUALITY
2084 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002085 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002086 public static final Key<Integer> EDGE_MODE =
2087 new Key<Integer>("android.edge.mode", int.class);
2088
2089 /**
Zhijun He66d065a2014-01-16 18:18:50 -08002090 * <p>The desired mode for for the camera device's flash control.</p>
2091 * <p>This control is only effective when flash unit is available
Zhijun He153ac102014-02-03 12:25:12 -08002092 * (<code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == true</code>).</p>
Zhijun He66d065a2014-01-16 18:18:50 -08002093 * <p>When this control is used, the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} must be set to ON or OFF.
2094 * Otherwise, the camera device auto-exposure related flash control (ON_AUTO_FLASH,
2095 * ON_ALWAYS_FLASH, or ON_AUTO_FLASH_REDEYE) will override this control.</p>
2096 * <p>When set to OFF, the camera device will not fire flash for this capture.</p>
2097 * <p>When set to SINGLE, the camera device will fire flash regardless of the camera
2098 * device's auto-exposure routine's result. When used in still capture case, this
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002099 * control should be used along with auto-exposure (AE) precapture metering sequence
Zhijun He66d065a2014-01-16 18:18:50 -08002100 * ({@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}), otherwise, the image may be incorrectly exposed.</p>
2101 * <p>When set to TORCH, the flash will be on continuously. This mode can be used
2102 * for use cases such as preview, auto-focus assist, still capture, or video recording.</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002103 * <p>The flash status will be reported by {@link CaptureResult#FLASH_STATE android.flash.state} in the capture result metadata.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002104 * <p><b>Possible values:</b>
2105 * <ul>
2106 * <li>{@link #FLASH_MODE_OFF OFF}</li>
2107 * <li>{@link #FLASH_MODE_SINGLE SINGLE}</li>
2108 * <li>{@link #FLASH_MODE_TORCH TORCH}</li>
2109 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002110 * <p>This key is available on all devices.</p>
Zhijun He66d065a2014-01-16 18:18:50 -08002111 *
2112 * @see CaptureRequest#CONTROL_AE_MODE
2113 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
2114 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
Zhijun Heca1b73a2014-02-03 12:39:53 -08002115 * @see CaptureResult#FLASH_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002116 * @see #FLASH_MODE_OFF
2117 * @see #FLASH_MODE_SINGLE
2118 * @see #FLASH_MODE_TORCH
2119 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002120 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002121 public static final Key<Integer> FLASH_MODE =
2122 new Key<Integer>("android.flash.mode", int.class);
2123
2124 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002125 * <p>Current state of the flash
Zhijun Heca1b73a2014-02-03 12:39:53 -08002126 * unit.</p>
2127 * <p>When the camera device doesn't have flash unit
2128 * (i.e. <code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == false</code>), this state will always be UNAVAILABLE.
2129 * Other states indicate the current flash status.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002130 * <p>In certain conditions, this will be available on LEGACY devices:</p>
2131 * <ul>
2132 * <li>Flash-less cameras always return UNAVAILABLE.</li>
2133 * <li>Using {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>==</code> ON_ALWAYS_FLASH
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002134 * will always return FIRED.</li>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002135 * <li>Using {@link CaptureRequest#FLASH_MODE android.flash.mode} <code>==</code> TORCH
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002136 * will always return FIRED.</li>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002137 * </ul>
2138 * <p>In all other conditions the state will not be available on
2139 * LEGACY devices (i.e. it will be <code>null</code>).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002140 * <p><b>Possible values:</b>
2141 * <ul>
2142 * <li>{@link #FLASH_STATE_UNAVAILABLE UNAVAILABLE}</li>
2143 * <li>{@link #FLASH_STATE_CHARGING CHARGING}</li>
2144 * <li>{@link #FLASH_STATE_READY READY}</li>
2145 * <li>{@link #FLASH_STATE_FIRED FIRED}</li>
2146 * <li>{@link #FLASH_STATE_PARTIAL PARTIAL}</li>
2147 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002148 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2149 * <p><b>Limited capability</b> -
2150 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2151 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002152 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002153 * @see CaptureRequest#CONTROL_AE_MODE
Zhijun Heca1b73a2014-02-03 12:39:53 -08002154 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002155 * @see CaptureRequest#FLASH_MODE
2156 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002157 * @see #FLASH_STATE_UNAVAILABLE
2158 * @see #FLASH_STATE_CHARGING
2159 * @see #FLASH_STATE_READY
2160 * @see #FLASH_STATE_FIRED
Zhijun He8dda7272014-03-25 13:49:30 -07002161 * @see #FLASH_STATE_PARTIAL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002162 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002163 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002164 public static final Key<Integer> FLASH_STATE =
2165 new Key<Integer>("android.flash.state", int.class);
2166
2167 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002168 * <p>Operational mode for hot pixel correction.</p>
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002169 * <p>Hotpixel correction interpolates out, or otherwise removes, pixels
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002170 * that do not accurately measure the incoming light (i.e. pixels that
2171 * are stuck at an arbitrary value or are oversensitive).</p>
2172 * <p><b>Possible values:</b>
2173 * <ul>
2174 * <li>{@link #HOT_PIXEL_MODE_OFF OFF}</li>
2175 * <li>{@link #HOT_PIXEL_MODE_FAST FAST}</li>
2176 * <li>{@link #HOT_PIXEL_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
2177 * </ul></p>
2178 * <p><b>Available values for this device:</b><br>
2179 * {@link CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES android.hotPixel.availableHotPixelModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002180 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002181 *
2182 * @see CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002183 * @see #HOT_PIXEL_MODE_OFF
2184 * @see #HOT_PIXEL_MODE_FAST
2185 * @see #HOT_PIXEL_MODE_HIGH_QUALITY
2186 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002187 @PublicKey
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002188 public static final Key<Integer> HOT_PIXEL_MODE =
2189 new Key<Integer>("android.hotPixel.mode", int.class);
2190
2191 /**
Ruben Brunk57493682014-05-27 18:58:08 -07002192 * <p>A location object to use when generating image GPS metadata.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002193 * <p>Setting a location object in a request will include the GPS coordinates of the location
2194 * into any JPEG images captured based on the request. These coordinates can then be
2195 * viewed by anyone who receives the JPEG image.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002196 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002197 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002198 @PublicKey
2199 @SyntheticKey
Ruben Brunk57493682014-05-27 18:58:08 -07002200 public static final Key<android.location.Location> JPEG_GPS_LOCATION =
2201 new Key<android.location.Location>("android.jpeg.gpsLocation", android.location.Location.class);
2202
2203 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002204 * <p>GPS coordinates to include in output JPEG
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002205 * EXIF.</p>
2206 * <p><b>Range of valid values:</b><br>
2207 * (-180 - 180], [-90,90], [-inf, inf]</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002208 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002209 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002210 */
2211 public static final Key<double[]> JPEG_GPS_COORDINATES =
2212 new Key<double[]>("android.jpeg.gpsCoordinates", double[].class);
2213
2214 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002215 * <p>32 characters describing GPS algorithm to
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002216 * include in EXIF.</p>
2217 * <p><b>Units</b>: UTF-8 null-terminated string</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002218 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002219 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002220 */
2221 public static final Key<String> JPEG_GPS_PROCESSING_METHOD =
2222 new Key<String>("android.jpeg.gpsProcessingMethod", String.class);
2223
2224 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002225 * <p>Time GPS fix was made to include in
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002226 * EXIF.</p>
2227 * <p><b>Units</b>: UTC in seconds since January 1, 1970</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002228 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002229 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002230 */
2231 public static final Key<Long> JPEG_GPS_TIMESTAMP =
2232 new Key<Long>("android.jpeg.gpsTimestamp", long.class);
2233
2234 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002235 * <p>The orientation for a JPEG image.</p>
2236 * <p>The clockwise rotation angle in degrees, relative to the orientation
2237 * to the camera, that the JPEG picture needs to be rotated by, to be viewed
2238 * upright.</p>
2239 * <p>Camera devices may either encode this value into the JPEG EXIF header, or
Yin-Chia Yehd49ebcc2015-03-27 13:54:04 -07002240 * rotate the image data to match this orientation. When the image data is rotated,
2241 * the thumbnail data will also be rotated.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002242 * <p>Note that this orientation is relative to the orientation of the camera sensor, given
2243 * by {@link CameraCharacteristics#SENSOR_ORIENTATION android.sensor.orientation}.</p>
2244 * <p>To translate from the device orientation given by the Android sensor APIs, the following
2245 * sample code may be used:</p>
2246 * <pre><code>private int getJpegOrientation(CameraCharacteristics c, int deviceOrientation) {
2247 * if (deviceOrientation == android.view.OrientationEventListener.ORIENTATION_UNKNOWN) return 0;
2248 * int sensorOrientation = c.get(CameraCharacteristics.SENSOR_ORIENTATION);
2249 *
2250 * // Round device orientation to a multiple of 90
2251 * deviceOrientation = (deviceOrientation + 45) / 90 * 90;
2252 *
2253 * // Reverse device orientation for front-facing cameras
2254 * boolean facingFront = c.get(CameraCharacteristics.LENS_FACING) == CameraCharacteristics.LENS_FACING_FRONT;
2255 * if (facingFront) deviceOrientation = -deviceOrientation;
2256 *
2257 * // Calculate desired JPEG orientation relative to camera orientation to make
2258 * // the image upright relative to the device orientation
2259 * int jpegOrientation = (sensorOrientation + deviceOrientation + 360) % 360;
2260 *
2261 * return jpegOrientation;
2262 * }
2263 * </code></pre>
2264 * <p><b>Units</b>: Degrees in multiples of 90</p>
2265 * <p><b>Range of valid values:</b><br>
2266 * 0, 90, 180, 270</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002267 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002268 *
2269 * @see CameraCharacteristics#SENSOR_ORIENTATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002270 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002271 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002272 public static final Key<Integer> JPEG_ORIENTATION =
2273 new Key<Integer>("android.jpeg.orientation", int.class);
2274
2275 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002276 * <p>Compression quality of the final JPEG
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002277 * image.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002278 * <p>85-95 is typical usage range.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002279 * <p><b>Range of valid values:</b><br>
2280 * 1-100; larger is higher quality</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002281 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002282 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002283 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002284 public static final Key<Byte> JPEG_QUALITY =
2285 new Key<Byte>("android.jpeg.quality", byte.class);
2286
2287 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002288 * <p>Compression quality of JPEG
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002289 * thumbnail.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002290 * <p><b>Range of valid values:</b><br>
2291 * 1-100; larger is higher quality</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002292 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002293 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002294 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002295 public static final Key<Byte> JPEG_THUMBNAIL_QUALITY =
2296 new Key<Byte>("android.jpeg.thumbnailQuality", byte.class);
2297
2298 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002299 * <p>Resolution of embedded JPEG thumbnail.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08002300 * <p>When set to (0, 0) value, the JPEG EXIF will not contain thumbnail,
2301 * but the captured JPEG will still be a valid image.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002302 * <p>For best results, when issuing a request for a JPEG image, the thumbnail size selected
2303 * should have the same aspect ratio as the main JPEG output.</p>
Zhijun He50f72432014-05-28 13:52:04 -07002304 * <p>If the thumbnail image aspect ratio differs from the JPEG primary image aspect
2305 * ratio, the camera device creates the thumbnail by cropping it from the primary image.
2306 * For example, if the primary image has 4:3 aspect ratio, the thumbnail image has
2307 * 16:9 aspect ratio, the primary image will be cropped vertically (letterbox) to
2308 * generate the thumbnail image. The thumbnail image will always have a smaller Field
2309 * Of View (FOV) than the primary image when aspect ratios differ.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002310 * <p><b>Range of valid values:</b><br>
2311 * {@link CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES android.jpeg.availableThumbnailSizes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002312 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002313 *
2314 * @see CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002315 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002316 @PublicKey
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07002317 public static final Key<android.util.Size> JPEG_THUMBNAIL_SIZE =
2318 new Key<android.util.Size>("android.jpeg.thumbnailSize", android.util.Size.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002319
2320 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002321 * <p>The desired lens aperture size, as a ratio of lens focal length to the
2322 * effective aperture diameter.</p>
2323 * <p>Setting this value is only supported on the camera devices that have a variable
2324 * aperture lens.</p>
Zhijun Hefb46c642014-01-14 17:57:23 -08002325 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF,
2326 * this can be set along with {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002327 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}
Zhijun Hefb46c642014-01-14 17:57:23 -08002328 * to achieve manual exposure control.</p>
2329 * <p>The requested aperture value may take several frames to reach the
2330 * requested value; the camera device will report the current (intermediate)
Zhijun Heca1b73a2014-02-03 12:39:53 -08002331 * aperture size in capture result metadata while the aperture is changing.
2332 * 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 -08002333 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of
2334 * the ON modes, this will be overridden by the camera device
2335 * auto-exposure algorithm, the overridden values are then provided
2336 * back to the user in the corresponding result.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002337 * <p><b>Units</b>: The f-number (f/N)</p>
2338 * <p><b>Range of valid values:</b><br>
2339 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002340 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2341 * <p><b>Full capability</b> -
2342 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2343 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Hefb46c642014-01-14 17:57:23 -08002344 *
Zhijun He399f05d2014-01-15 11:31:30 -08002345 * @see CaptureRequest#CONTROL_AE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002346 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002347 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
Zhijun Heca1b73a2014-02-03 12:39:53 -08002348 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002349 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002350 * @see CaptureRequest#SENSOR_FRAME_DURATION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002351 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002352 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002353 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002354 public static final Key<Float> LENS_APERTURE =
2355 new Key<Float>("android.lens.aperture", float.class);
2356
2357 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002358 * <p>The desired setting for the lens neutral density filter(s).</p>
2359 * <p>This control will not be supported on most camera devices.</p>
Ruben Brunk855bae42014-01-17 10:30:32 -08002360 * <p>Lens filters are typically used to lower the amount of light the
2361 * sensor is exposed to (measured in steps of EV). As used here, an EV
2362 * step is the standard logarithmic representation, which are
2363 * non-negative, and inversely proportional to the amount of light
2364 * hitting the sensor. For example, setting this to 0 would result
2365 * in no reduction of the incoming light, and setting this to 2 would
2366 * mean that the filter is set to reduce incoming light by two stops
2367 * (allowing 1/4 of the prior amount of light to the sensor).</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002368 * <p>It may take several frames before the lens filter density changes
2369 * to the requested value. While the filter density is still changing,
2370 * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002371 * <p><b>Units</b>: Exposure Value (EV)</p>
2372 * <p><b>Range of valid values:</b><br>
2373 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002374 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2375 * <p><b>Full capability</b> -
2376 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2377 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk855bae42014-01-17 10:30:32 -08002378 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002379 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk855bae42014-01-17 10:30:32 -08002380 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
Zhijun Heca1b73a2014-02-03 12:39:53 -08002381 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002382 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002383 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002384 public static final Key<Float> LENS_FILTER_DENSITY =
2385 new Key<Float>("android.lens.filterDensity", float.class);
2386
2387 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002388 * <p>The desired lens focal length; used for optical zoom.</p>
Ruben Brunka20f4c22014-01-17 15:21:13 -08002389 * <p>This setting controls the physical focal length of the camera
2390 * device's lens. Changing the focal length changes the field of
2391 * view of the camera device, and is usually used for optical zoom.</p>
2392 * <p>Like {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, this
2393 * setting won't be applied instantaneously, and it may take several
Zhijun Heca1b73a2014-02-03 12:39:53 -08002394 * frames before the lens can change to the requested focal length.
Ruben Brunka20f4c22014-01-17 15:21:13 -08002395 * While the focal length is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will
2396 * be set to MOVING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002397 * <p>Optical zoom will not be supported on most devices.</p>
2398 * <p><b>Units</b>: Millimeters</p>
2399 * <p><b>Range of valid values:</b><br>
2400 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002401 * <p>This key is available on all devices.</p>
Ruben Brunka20f4c22014-01-17 15:21:13 -08002402 *
2403 * @see CaptureRequest#LENS_APERTURE
2404 * @see CaptureRequest#LENS_FOCUS_DISTANCE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002405 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS
Ruben Brunka20f4c22014-01-17 15:21:13 -08002406 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002407 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002408 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002409 public static final Key<Float> LENS_FOCAL_LENGTH =
2410 new Key<Float>("android.lens.focalLength", float.class);
2411
2412 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002413 * <p>Desired distance to plane of sharpest focus,
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002414 * measured from frontmost surface of the lens.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002415 * <p>Should be zero for fixed-focus cameras</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002416 * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p>
2417 * <p><b>Range of valid values:</b><br>
2418 * &gt;= 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002419 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2420 * <p><b>Full capability</b> -
2421 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2422 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2423 *
2424 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002425 * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002426 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002427 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002428 public static final Key<Float> LENS_FOCUS_DISTANCE =
2429 new Key<Float>("android.lens.focusDistance", float.class);
2430
2431 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002432 * <p>The range of scene distances that are in
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002433 * sharp focus (depth of field).</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002434 * <p>If variable focus not supported, can still report
2435 * fixed depth of field range</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002436 * <p><b>Units</b>: A pair of focus distances in diopters: (near,
2437 * far); see {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details.</p>
2438 * <p><b>Range of valid values:</b><br>
2439 * &gt;=0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002440 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2441 * <p><b>Limited capability</b> -
2442 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2443 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2444 *
2445 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002446 * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002447 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002448 @PublicKey
Igor Murashkin57438682014-05-30 10:49:00 -07002449 public static final Key<android.util.Pair<Float,Float>> LENS_FOCUS_RANGE =
2450 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 -07002451
2452 /**
Ruben Brunk00849b32014-01-17 18:30:23 -08002453 * <p>Sets whether the camera device uses optical image stabilization (OIS)
2454 * when capturing images.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002455 * <p>OIS is used to compensate for motion blur due to small
2456 * movements of the camera during capture. Unlike digital image
2457 * stabilization ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), OIS
2458 * makes use of mechanical elements to stabilize the camera
2459 * sensor, and thus allows for longer exposure times before
2460 * camera shake becomes apparent.</p>
Zhijun He45fa43a12014-06-13 18:29:37 -07002461 * <p>Switching between different optical stabilization modes may take several
2462 * frames to initialize, the camera device will report the current mode in
2463 * capture result metadata. For example, When "ON" mode is requested, the
2464 * optical stabilization modes in the first several capture results may still
2465 * be "OFF", and it will become "ON" when the initialization is done.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002466 * <p>If a camera device supports both OIS and digital image stabilization
2467 * ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), turning both modes on may produce undesirable
2468 * interaction, so it is recommended not to enable both at the same time.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002469 * <p>Not all devices will support OIS; see
2470 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization} for
2471 * available controls.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002472 * <p><b>Possible values:</b>
2473 * <ul>
2474 * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_OFF OFF}</li>
2475 * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_ON ON}</li>
2476 * </ul></p>
2477 * <p><b>Available values for this device:</b><br>
2478 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002479 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2480 * <p><b>Limited capability</b> -
2481 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2482 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002483 *
2484 * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002485 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002486 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002487 * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF
2488 * @see #LENS_OPTICAL_STABILIZATION_MODE_ON
2489 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002490 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002491 public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE =
2492 new Key<Integer>("android.lens.opticalStabilizationMode", int.class);
2493
2494 /**
Zhijun Heca1b73a2014-02-03 12:39:53 -08002495 * <p>Current lens status.</p>
2496 * <p>For lens parameters {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}, {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance},
2497 * {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, when changes are requested,
2498 * they may take several frames to reach the requested values. This state indicates
2499 * the current status of the lens parameters.</p>
2500 * <p>When the state is STATIONARY, the lens parameters are not changing. This could be
2501 * either because the parameters are all fixed, or because the lens has had enough
2502 * time to reach the most recently-requested values.
2503 * If all these lens parameters are not changable for a camera device, as listed below:</p>
2504 * <ul>
2505 * <li>Fixed focus (<code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} == 0</code>), which means
2506 * {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} parameter will always be 0.</li>
2507 * <li>Fixed focal length ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths} contains single value),
2508 * which means the optical zoom is not supported.</li>
2509 * <li>No ND filter ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities} contains only 0).</li>
2510 * <li>Fixed aperture ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures} contains single value).</li>
2511 * </ul>
2512 * <p>Then this state will always be STATIONARY.</p>
2513 * <p>When the state is MOVING, it indicates that at least one of the lens parameters
2514 * is changing.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002515 * <p><b>Possible values:</b>
2516 * <ul>
2517 * <li>{@link #LENS_STATE_STATIONARY STATIONARY}</li>
2518 * <li>{@link #LENS_STATE_MOVING MOVING}</li>
2519 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002520 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2521 * <p><b>Limited capability</b> -
2522 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2523 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002524 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002525 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun Heca1b73a2014-02-03 12:39:53 -08002526 * @see CaptureRequest#LENS_APERTURE
2527 * @see CaptureRequest#LENS_FILTER_DENSITY
2528 * @see CaptureRequest#LENS_FOCAL_LENGTH
2529 * @see CaptureRequest#LENS_FOCUS_DISTANCE
2530 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
2531 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
2532 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS
2533 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002534 * @see #LENS_STATE_STATIONARY
Igor Murashkin9ea4ae62013-09-11 21:40:11 -07002535 * @see #LENS_STATE_MOVING
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002536 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002537 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002538 public static final Key<Integer> LENS_STATE =
2539 new Key<Integer>("android.lens.state", int.class);
2540
2541 /**
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002542 * <p>The orientation of the camera relative to the sensor
2543 * coordinate system.</p>
2544 * <p>The four coefficients that describe the quarternion
2545 * rotation from the Android sensor coordinate system to a
2546 * camera-aligned coordinate system where the X-axis is
2547 * aligned with the long side of the image sensor, the Y-axis
2548 * is aligned with the short side of the image sensor, and
2549 * the Z-axis is aligned with the optical axis of the sensor.</p>
2550 * <p>To convert from the quarternion coefficients <code>(x,y,z,w)</code>
2551 * to the axis of rotation <code>(a_x, a_y, a_z)</code> and rotation
2552 * amount <code>theta</code>, the following formulas can be used:</p>
2553 * <pre><code> theta = 2 * acos(w)
2554 * a_x = x / sin(theta/2)
2555 * a_y = y / sin(theta/2)
2556 * a_z = z / sin(theta/2)
2557 * </code></pre>
2558 * <p>To create a 3x3 rotation matrix that applies the rotation
2559 * defined by this quarternion, the following matrix can be
2560 * used:</p>
2561 * <pre><code>R = [ 1 - 2y^2 - 2z^2, 2xy - 2zw, 2xz + 2yw,
2562 * 2xy + 2zw, 1 - 2x^2 - 2z^2, 2yz - 2xw,
2563 * 2xz - 2yw, 2yz + 2xw, 1 - 2x^2 - 2y^2 ]
2564 * </code></pre>
2565 * <p>This matrix can then be used to apply the rotation to a
2566 * column vector point with</p>
2567 * <p><code>p' = Rp</code></p>
2568 * <p>where <code>p</code> is in the device sensor coordinate system, and
2569 * <code>p'</code> is in the camera-oriented coordinate system.</p>
2570 * <p><b>Units</b>:
2571 * Quarternion coefficients</p>
2572 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2573 */
2574 @PublicKey
2575 public static final Key<float[]> LENS_POSE_ROTATION =
2576 new Key<float[]>("android.lens.poseRotation", float[].class);
2577
2578 /**
2579 * <p>Position of the camera optical center.</p>
2580 * <p>As measured in the device sensor coordinate system, the
2581 * position of the camera device's optical center, as a
2582 * three-dimensional vector <code>(x,y,z)</code>.</p>
2583 * <p>To transform a world position to a camera-device centered
2584 * coordinate system, the position must be translated by this
2585 * vector and then rotated by {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation}.</p>
2586 * <p><b>Units</b>: Meters</p>
2587 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2588 *
2589 * @see CameraCharacteristics#LENS_POSE_ROTATION
2590 */
2591 @PublicKey
2592 public static final Key<float[]> LENS_POSE_TRANSLATION =
2593 new Key<float[]>("android.lens.poseTranslation", float[].class);
2594
2595 /**
2596 * <p>The parameters for this camera device's intrinsic
2597 * calibration.</p>
2598 * <p>The five calibration parameters that describe the
2599 * transform from camera-centric 3D coordinates to sensor
2600 * pixel coordinates:</p>
2601 * <pre><code>[f_x, f_y, c_x, c_y, s]
2602 * </code></pre>
2603 * <p>Where <code>f_x</code> and <code>f_y</code> are the horizontal and vertical
2604 * focal lengths, <code>[c_x, c_y]</code> is the position of the optical
2605 * axis, and <code>s</code> is a skew parameter for the sensor plane not
2606 * being aligned with the lens plane.</p>
2607 * <p>These are typically used within a transformation matrix K:</p>
2608 * <pre><code>K = [ f_x, s, c_x,
2609 * 0, f_y, c_y,
2610 * 0 0, 1 ]
2611 * </code></pre>
2612 * <p>which can then be combined with the camera pose rotation
2613 * <code>R</code> and translation <code>t</code> ({@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} and
2614 * {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation}, respective) to calculate the
2615 * complete transform from world coordinates to pixel
2616 * coordinates:</p>
2617 * <pre><code>P = [ K 0 * [ R t
2618 * 0 1 ] 0 1 ]
2619 * </code></pre>
2620 * <p>and with <code>p_w</code> being a point in the world coordinate system
2621 * and <code>p_s</code> being a point in the camera active pixel array
2622 * coordinate system, and with the mapping including the
2623 * homogeneous division by z:</p>
2624 * <pre><code> p_h = (x_h, y_h, z_h) = P p_w
2625 * p_s = p_h / z_h
2626 * </code></pre>
2627 * <p>so <code>[x_s, y_s]</code> is the pixel coordinates of the world
2628 * point, <code>z_s = 1</code>, and <code>w_s</code> is a measurement of disparity
2629 * (depth) in pixel coordinates.</p>
2630 * <p><b>Units</b>:
2631 * Pixels in the android.sensor.activeArraySize coordinate
2632 * system.</p>
2633 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2634 *
2635 * @see CameraCharacteristics#LENS_POSE_ROTATION
2636 * @see CameraCharacteristics#LENS_POSE_TRANSLATION
2637 */
2638 @PublicKey
2639 public static final Key<float[]> LENS_INTRINSIC_CALIBRATION =
2640 new Key<float[]>("android.lens.intrinsicCalibration", float[].class);
2641
2642 /**
2643 * <p>The correction coefficients to correct for this camera device's
2644 * radial lens distortion.</p>
2645 * <p>Three cofficients <code>[kappa_1, kappa_2, kappa_3]</code> that
2646 * can be used to correct the lens's radial geometric
2647 * distortion with the mapping equations:</p>
2648 * <pre><code> x_c = x_i * ( 1 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 )
2649 * y_c = y_i * ( 1 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 )
2650 * </code></pre>
2651 * <p>where <code>[x_i, y_i]</code> are normalized coordinates with <code>(0,0)</code>
2652 * at the lens optical center, and <code>[-1, 1]</code> are the edges of
2653 * the active pixel array; and where <code>[x_c, y_c]</code> are the
2654 * corrected normalized coordinates with radial distortion
2655 * removed; and <code>r^2 = x_i^2 + y_i^2</code>.</p>
2656 * <p><b>Units</b>:
2657 * Coefficients for a 6th-degree even radial polynomial.</p>
2658 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2659 */
2660 @PublicKey
2661 public static final Key<float[]> LENS_RADIAL_DISTORTION =
2662 new Key<float[]>("android.lens.radialDistortion", float[].class);
2663
2664 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002665 * <p>Mode of operation for the noise reduction algorithm.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002666 * <p>The noise reduction algorithm attempts to improve image quality by removing
Zhijun He0e99c222015-01-29 15:26:05 -08002667 * excessive noise added by the capture process, especially in dark conditions.</p>
2668 * <p>OFF means no noise reduction will be applied by the camera device, for both raw and
2669 * YUV domain.</p>
2670 * <p>MINIMAL means that only sensor raw domain basic noise reduction is enabled ,to remove
2671 * demosaicing or other processing artifacts. For YUV_REPROCESSING, MINIMAL is same as OFF.
2672 * This mode is optional, may not be support by all devices. The application should check
2673 * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes} before using it.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08002674 * <p>FAST/HIGH_QUALITY both mean camera device determined noise filtering
2675 * will be applied. HIGH_QUALITY mode indicates that the camera device
2676 * will use the highest-quality noise filtering algorithms,
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002677 * even if it slows down capture rate. FAST means the camera device will not
Zhijun He28079362013-12-17 10:35:40 -08002678 * slow down capture rate when applying noise filtering.</p>
Zhijun He0e99c222015-01-29 15:26:05 -08002679 * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera device
2680 * will apply FAST/HIGH_QUALITY YUV domain noise reduction, respectively. The camera device
2681 * may adjust the noise reduction parameters for best image quality based on the
2682 * {@link CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR android.reprocess.effectiveExposureFactor} if it is set.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002683 * <p><b>Possible values:</b>
2684 * <ul>
2685 * <li>{@link #NOISE_REDUCTION_MODE_OFF OFF}</li>
2686 * <li>{@link #NOISE_REDUCTION_MODE_FAST FAST}</li>
2687 * <li>{@link #NOISE_REDUCTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
Zhijun He0e99c222015-01-29 15:26:05 -08002688 * <li>{@link #NOISE_REDUCTION_MODE_MINIMAL MINIMAL}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002689 * </ul></p>
2690 * <p><b>Available values for this device:</b><br>
2691 * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002692 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2693 * <p><b>Full capability</b> -
2694 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2695 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002696 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002697 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002698 * @see CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES
Zhijun He0e99c222015-01-29 15:26:05 -08002699 * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002700 * @see #NOISE_REDUCTION_MODE_OFF
2701 * @see #NOISE_REDUCTION_MODE_FAST
2702 * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY
Zhijun He0e99c222015-01-29 15:26:05 -08002703 * @see #NOISE_REDUCTION_MODE_MINIMAL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002704 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002705 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002706 public static final Key<Integer> NOISE_REDUCTION_MODE =
2707 new Key<Integer>("android.noiseReduction.mode", int.class);
2708
2709 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002710 * <p>Whether a result given to the framework is the
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002711 * final one for the capture, or only a partial that contains a
2712 * subset of the full set of dynamic metadata
Igor Murashkinace5bf02013-12-10 17:36:40 -08002713 * values.</p>
2714 * <p>The entries in the result metadata buffers for a
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002715 * single capture may not overlap, except for this entry. The
2716 * FINAL buffers must retain FIFO ordering relative to the
2717 * requests that generate them, so the FINAL buffer for frame 3 must
2718 * always be sent to the framework after the FINAL buffer for frame 2, and
2719 * before the FINAL buffer for frame 4. PARTIAL buffers may be returned
2720 * in any order relative to other frames, but all PARTIAL buffers for a given
2721 * capture must arrive before the FINAL buffer for that capture. This entry may
Zhijun Hecc28a412014-02-24 15:11:23 -08002722 * only be used by the camera device if quirks.usePartialResult is set to 1.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002723 * <p><b>Range of valid values:</b><br>
2724 * Optional. Default value is FINAL.</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08002725 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07002726 * @deprecated
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002727 * @hide
2728 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002729 @Deprecated
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002730 public static final Key<Boolean> QUIRKS_PARTIAL_RESULT =
2731 new Key<Boolean>("android.quirks.partialResult", boolean.class);
2732
2733 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002734 * <p>A frame counter set by the framework. This value monotonically
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -07002735 * increases with every new result (that is, each new result has a unique
Igor Murashkinace5bf02013-12-10 17:36:40 -08002736 * frameCount value).</p>
2737 * <p>Reset on release()</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002738 * <p><b>Units</b>: count of frames</p>
2739 * <p><b>Range of valid values:</b><br>
2740 * &gt; 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002741 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkinbdf366c2014-07-25 16:54:20 -07002742 * @deprecated
2743 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002744 */
Igor Murashkinbdf366c2014-07-25 16:54:20 -07002745 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002746 public static final Key<Integer> REQUEST_FRAME_COUNT =
2747 new Key<Integer>("android.request.frameCount", int.class);
2748
2749 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002750 * <p>An application-specified ID for the current
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002751 * request. Must be maintained unchanged in output
Igor Murashkinace5bf02013-12-10 17:36:40 -08002752 * frame</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002753 * <p><b>Units</b>: arbitrary integer assigned by application</p>
2754 * <p><b>Range of valid values:</b><br>
2755 * Any int</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002756 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002757 * @hide
2758 */
2759 public static final Key<Integer> REQUEST_ID =
2760 new Key<Integer>("android.request.id", int.class);
2761
2762 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08002763 * <p>Specifies the number of pipeline stages the frame went
2764 * through from when it was exposed to when the final completed result
2765 * was available to the framework.</p>
2766 * <p>Depending on what settings are used in the request, and
2767 * what streams are configured, the data may undergo less processing,
2768 * and some pipeline stages skipped.</p>
2769 * <p>See {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} for more details.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002770 * <p><b>Range of valid values:</b><br>
2771 * &lt;= {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002772 * <p>This key is available on all devices.</p>
Igor Murashkinc127f052014-01-17 18:06:02 -08002773 *
2774 * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
2775 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002776 @PublicKey
Igor Murashkinc127f052014-01-17 18:06:02 -08002777 public static final Key<Byte> REQUEST_PIPELINE_DEPTH =
2778 new Key<Byte>("android.request.pipelineDepth", byte.class);
2779
2780 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002781 * <p>The desired region of the sensor to read out for this capture.</p>
2782 * <p>This control can be used to implement digital zoom.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002783 * <p>The crop region coordinate system is based off
2784 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being the
2785 * top-left corner of the sensor active array.</p>
2786 * <p>Output streams use this rectangle to produce their output,
2787 * cropping to a smaller region if necessary to maintain the
2788 * stream's aspect ratio, then scaling the sensor input to
2789 * match the output's configured resolution.</p>
2790 * <p>The crop region is applied after the RAW to other color
2791 * space (e.g. YUV) conversion. Since raw streams
2792 * (e.g. RAW16) don't have the conversion stage, they are not
2793 * croppable. The crop region will be ignored by raw streams.</p>
Zhijun He9e6d1882014-05-22 16:47:35 -07002794 * <p>For non-raw streams, any additional per-stream cropping will
2795 * be done to maximize the final pixel area of the stream.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002796 * <p>For example, if the crop region is set to a 4:3 aspect
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002797 * ratio, then 4:3 streams will use the exact crop
2798 * region. 16:9 streams will further crop vertically
Igor Murashkinace5bf02013-12-10 17:36:40 -08002799 * (letterbox).</p>
2800 * <p>Conversely, if the crop region is set to a 16:9, then 4:3
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002801 * outputs will crop horizontally (pillarbox), and 16:9
2802 * streams will match exactly. These additional crops will
Igor Murashkinace5bf02013-12-10 17:36:40 -08002803 * be centered within the crop region.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002804 * <p>The width and height of the crop region cannot
2805 * be set to be smaller than
2806 * <code>floor( activeArraySize.width / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code> and
2807 * <code>floor( activeArraySize.height / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code>, respectively.</p>
2808 * <p>The camera device may adjust the crop region to account
2809 * for rounding and other hardware requirements; the final
2810 * crop region used will be included in the output capture
2811 * result.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002812 * <p><b>Units</b>: Pixel coordinates relative to
2813 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002814 * <p>This key is available on all devices.</p>
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002815 *
2816 * @see CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002817 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002818 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002819 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002820 public static final Key<android.graphics.Rect> SCALER_CROP_REGION =
2821 new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class);
2822
2823 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002824 * <p>Duration each pixel is exposed to
2825 * light.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002826 * <p>If the sensor can't expose this exact duration, it will shorten the
2827 * duration exposed to the nearest possible value (rather than expose longer).
2828 * The final exposure time used will be available in the output capture result.</p>
2829 * <p>This control is only effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} is set to
2830 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
2831 * <p><b>Units</b>: Nanoseconds</p>
2832 * <p><b>Range of valid values:</b><br>
2833 * {@link CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE android.sensor.info.exposureTimeRange}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002834 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2835 * <p><b>Full capability</b> -
2836 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2837 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2838 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002839 * @see CaptureRequest#CONTROL_AE_MODE
2840 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002841 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002842 * @see CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002843 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002844 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002845 public static final Key<Long> SENSOR_EXPOSURE_TIME =
2846 new Key<Long>("android.sensor.exposureTime", long.class);
2847
2848 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002849 * <p>Duration from start of frame exposure to
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002850 * start of next frame exposure.</p>
2851 * <p>The maximum frame rate that can be supported by a camera subsystem is
2852 * a function of many factors:</p>
2853 * <ul>
2854 * <li>Requested resolutions of output image streams</li>
2855 * <li>Availability of binning / skipping modes on the imager</li>
2856 * <li>The bandwidth of the imager interface</li>
2857 * <li>The bandwidth of the various ISP processing blocks</li>
2858 * </ul>
2859 * <p>Since these factors can vary greatly between different ISPs and
2860 * sensors, the camera abstraction tries to represent the bandwidth
2861 * restrictions with as simple a model as possible.</p>
2862 * <p>The model presented has the following characteristics:</p>
2863 * <ul>
2864 * <li>The image sensor is always configured to output the smallest
2865 * resolution possible given the application's requested output stream
2866 * sizes. The smallest resolution is defined as being at least as large
2867 * as the largest requested output stream size; the camera pipeline must
2868 * never digitally upsample sensor data when the crop region covers the
2869 * whole sensor. In general, this means that if only small output stream
2870 * resolutions are configured, the sensor can provide a higher frame
2871 * rate.</li>
2872 * <li>Since any request may use any or all the currently configured
2873 * output streams, the sensor and ISP must be configured to support
2874 * scaling a single capture to all the streams at the same time. This
2875 * means the camera pipeline must be ready to produce the largest
2876 * requested output size without any delay. Therefore, the overall
2877 * frame rate of a given configured stream set is governed only by the
2878 * largest requested stream resolution.</li>
2879 * <li>Using more than one output stream in a request does not affect the
2880 * frame duration.</li>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002881 * <li>Certain format-streams may need to do additional background processing
2882 * before data is consumed/produced by that stream. These processors
2883 * can run concurrently to the rest of the camera pipeline, but
2884 * cannot process more than 1 capture at a time.</li>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002885 * </ul>
2886 * <p>The necessary information for the application, given the model above,
Igor Murashkin9c595172014-05-12 13:56:20 -07002887 * is provided via the {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} field
2888 * using StreamConfigurationMap#getOutputMinFrameDuration(int, Size).
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002889 * These are used to determine the maximum frame rate / minimum frame
2890 * duration that is possible for a given stream configuration.</p>
2891 * <p>Specifically, the application can use the following rules to
Igor Murashkina23ffb52014-02-07 18:52:34 -08002892 * determine the minimum frame duration it can request from the camera
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002893 * device:</p>
2894 * <ol>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002895 * <li>Let the set of currently configured input/output streams
2896 * be called <code>S</code>.</li>
2897 * <li>Find the minimum frame durations for each stream in <code>S</code>, by
Igor Murashkin9c595172014-05-12 13:56:20 -07002898 * looking it up in {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} using
2899 * StreamConfigurationMap#getOutputMinFrameDuration(int, Size) (with
Igor Murashkina23ffb52014-02-07 18:52:34 -08002900 * its respective size/format). Let this set of frame durations be called
2901 * <code>F</code>.</li>
2902 * <li>For any given request <code>R</code>, the minimum frame duration allowed
2903 * for <code>R</code> is the maximum out of all values in <code>F</code>. Let the streams
2904 * used in <code>R</code> be called <code>S_r</code>.</li>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002905 * </ol>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002906 * <p>If none of the streams in <code>S_r</code> have a stall time (listed in
Igor Murashkin9c595172014-05-12 13:56:20 -07002907 * StreamConfigurationMap#getOutputStallDuration(int,Size) using its
2908 * respective size/format), then the frame duration in
Igor Murashkina23ffb52014-02-07 18:52:34 -08002909 * <code>F</code> determines the steady state frame rate that the application will
2910 * get if it uses <code>R</code> as a repeating request. Let this special kind
2911 * of request be called <code>Rsimple</code>.</p>
2912 * <p>A repeating request <code>Rsimple</code> can be <em>occasionally</em> interleaved
2913 * by a single capture of a new request <code>Rstall</code> (which has at least
2914 * one in-use stream with a non-0 stall time) and if <code>Rstall</code> has the
2915 * same minimum frame duration this will not cause a frame rate loss
2916 * if all buffers from the previous <code>Rstall</code> have already been
2917 * delivered.</p>
2918 * <p>For more details about stalling, see
Igor Murashkin9c595172014-05-12 13:56:20 -07002919 * StreamConfigurationMap#getOutputStallDuration(int,Size).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002920 * <p>This control is only effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} is set to
2921 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
2922 * <p><b>Units</b>: Nanoseconds</p>
2923 * <p><b>Range of valid values:</b><br>
2924 * See {@link CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION android.sensor.info.maxFrameDuration},
2925 * {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}. The duration
2926 * is capped to <code>max(duration, exposureTime + overhead)</code>.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002927 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2928 * <p><b>Full capability</b> -
2929 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2930 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002931 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002932 * @see CaptureRequest#CONTROL_AE_MODE
2933 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002934 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Igor Murashkin9c595172014-05-12 13:56:20 -07002935 * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002936 * @see CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002937 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002938 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002939 public static final Key<Long> SENSOR_FRAME_DURATION =
2940 new Key<Long>("android.sensor.frameDuration", long.class);
2941
2942 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002943 * <p>The amount of gain applied to sensor data
2944 * before processing.</p>
2945 * <p>The sensitivity is the standard ISO sensitivity value,
2946 * as defined in ISO 12232:2006.</p>
2947 * <p>The sensitivity must be within {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}, and
2948 * if if it less than {@link CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY android.sensor.maxAnalogSensitivity}, the camera device
2949 * is guaranteed to use only analog amplification for applying the gain.</p>
2950 * <p>If the camera device cannot apply the exact sensitivity
2951 * requested, it will reduce the gain to the nearest supported
2952 * value. The final sensitivity used will be available in the
2953 * output capture result.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002954 * <p><b>Units</b>: ISO arithmetic units</p>
2955 * <p><b>Range of valid values:</b><br>
2956 * {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002957 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2958 * <p><b>Full capability</b> -
2959 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2960 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002961 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002962 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002963 * @see CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE
2964 * @see CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002965 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002966 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002967 public static final Key<Integer> SENSOR_SENSITIVITY =
2968 new Key<Integer>("android.sensor.sensitivity", int.class);
2969
2970 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002971 * <p>Time at start of exposure of first
Zhijun He0bda31a2014-06-13 14:38:39 -07002972 * row of the image sensor active array, in nanoseconds.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002973 * <p>The timestamps are also included in all image
2974 * buffers produced for the same capture, and will be identical
Zhijun He45fa43a12014-06-13 18:29:37 -07002975 * on all the outputs.</p>
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07002976 * <p>When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> UNKNOWN,
Zhijun He45fa43a12014-06-13 18:29:37 -07002977 * the timestamps measure time since an unspecified starting point,
2978 * and are monotonically increasing. They can be compared with the
2979 * timestamps for other captures from the same camera device, but are
2980 * not guaranteed to be comparable to any other time source.</p>
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07002981 * <p>When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> REALTIME,
Zhijun He45fa43a12014-06-13 18:29:37 -07002982 * the timestamps measure time in the same timebase as
2983 * android.os.SystemClock#elapsedRealtimeNanos(), and they can be
2984 * compared to other timestamps from other subsystems that are using
2985 * that base.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002986 * <p><b>Units</b>: Nanoseconds</p>
2987 * <p><b>Range of valid values:</b><br>
2988 * &gt; 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002989 * <p>This key is available on all devices.</p>
Zhijun He45fa43a12014-06-13 18:29:37 -07002990 *
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07002991 * @see CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002992 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002993 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002994 public static final Key<Long> SENSOR_TIMESTAMP =
2995 new Key<Long>("android.sensor.timestamp", long.class);
2996
2997 /**
Ruben Brunk7c062362014-04-15 23:53:53 -07002998 * <p>The estimated camera neutral color in the native sensor colorspace at
2999 * the time of capture.</p>
3000 * <p>This value gives the neutral color point encoded as an RGB value in the
3001 * native sensor color space. The neutral color point indicates the
3002 * currently estimated white point of the scene illumination. It can be
3003 * used to interpolate between the provided color transforms when
3004 * processing raw sensor data.</p>
3005 * <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 -08003006 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3007 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003008 @PublicKey
Ruben Brunk20c76f62014-02-07 15:47:10 -08003009 public static final Key<Rational[]> SENSOR_NEUTRAL_COLOR_POINT =
3010 new Key<Rational[]>("android.sensor.neutralColorPoint", Rational[].class);
3011
3012 /**
Ruben Brunk1b1f1b62014-07-23 17:49:08 -07003013 * <p>Noise model coefficients for each CFA mosaic channel.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003014 * <p>This key contains two noise model coefficients for each CFA channel
Ruben Brunk1b1f1b62014-07-23 17:49:08 -07003015 * corresponding to the sensor amplification (S) and sensor readout
3016 * noise (O). These are given as pairs of coefficients for each channel
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003017 * in the same order as channels listed for the CFA layout key
Ruben Brunk1b1f1b62014-07-23 17:49:08 -07003018 * (see {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT android.sensor.info.colorFilterArrangement}). This is
3019 * represented as an array of Pair&lt;Double, Double&gt;, where
3020 * the first member of the Pair at index n is the S coefficient and the
3021 * second member is the O coefficient for the nth color channel in the CFA.</p>
3022 * <p>These coefficients are used in a two parameter noise model to describe
3023 * the amount of noise present in the image for each CFA channel. The
3024 * noise model used here is:</p>
3025 * <p>N(x) = sqrt(Sx + O)</p>
3026 * <p>Where x represents the recorded signal of a CFA channel normalized to
3027 * the range [0, 1], and S and O are the noise model coeffiecients for
3028 * that channel.</p>
3029 * <p>A more detailed description of the noise model can be found in the
3030 * Adobe DNG specification for the NoiseProfile tag.</p>
3031 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3032 *
3033 * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
3034 */
3035 @PublicKey
3036 public static final Key<android.util.Pair<Double,Double>[]> SENSOR_NOISE_PROFILE =
3037 new Key<android.util.Pair<Double,Double>[]>("android.sensor.noiseProfile", new TypeReference<android.util.Pair<Double,Double>[]>() {{ }});
3038
3039 /**
Ruben Brunk987d9f72014-02-11 18:00:24 -08003040 * <p>The worst-case divergence between Bayer green channels.</p>
3041 * <p>This value is an estimate of the worst case split between the
3042 * Bayer green channels in the red and blue rows in the sensor color
3043 * filter array.</p>
3044 * <p>The green split is calculated as follows:</p>
3045 * <ol>
Ruben Brunke89b1202014-03-24 17:10:35 -07003046 * <li>A 5x5 pixel (or larger) window W within the active sensor array is
3047 * chosen. The term 'pixel' here is taken to mean a group of 4 Bayer
3048 * mosaic channels (R, Gr, Gb, B). The location and size of the window
3049 * chosen is implementation defined, and should be chosen to provide a
3050 * green split estimate that is both representative of the entire image
3051 * for this camera sensor, and can be calculated quickly.</li>
Ruben Brunk987d9f72014-02-11 18:00:24 -08003052 * <li>The arithmetic mean of the green channels from the red
3053 * rows (mean_Gr) within W is computed.</li>
3054 * <li>The arithmetic mean of the green channels from the blue
3055 * rows (mean_Gb) within W is computed.</li>
3056 * <li>The maximum ratio R of the two means is computed as follows:
3057 * <code>R = max((mean_Gr + 1)/(mean_Gb + 1), (mean_Gb + 1)/(mean_Gr + 1))</code></li>
3058 * </ol>
3059 * <p>The ratio R is the green split divergence reported for this property,
3060 * which represents how much the green channels differ in the mosaic
3061 * pattern. This value is typically used to determine the treatment of
3062 * the green mosaic channels when demosaicing.</p>
3063 * <p>The green split value can be roughly interpreted as follows:</p>
3064 * <ul>
3065 * <li>R &lt; 1.03 is a negligible split (&lt;3% divergence).</li>
3066 * <li>1.20 &lt;= R &gt;= 1.03 will require some software
3067 * correction to avoid demosaic errors (3-20% divergence).</li>
3068 * <li>R &gt; 1.20 will require strong software correction to produce
3069 * a usuable image (&gt;20% divergence).</li>
3070 * </ul>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003071 * <p><b>Range of valid values:</b><br></p>
3072 * <p>&gt;= 0</p>
Ruben Brunk987d9f72014-02-11 18:00:24 -08003073 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3074 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003075 @PublicKey
Ruben Brunk987d9f72014-02-11 18:00:24 -08003076 public static final Key<Float> SENSOR_GREEN_SPLIT =
3077 new Key<Float>("android.sensor.greenSplit", float.class);
3078
3079 /**
Zhijun He379af012014-05-06 11:54:54 -07003080 * <p>A pixel <code>[R, G_even, G_odd, B]</code> that supplies the test pattern
3081 * when {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode} is SOLID_COLOR.</p>
3082 * <p>Each color channel is treated as an unsigned 32-bit integer.
3083 * The camera device then uses the most significant X bits
3084 * that correspond to how many bits are in its Bayer raw sensor
3085 * output.</p>
3086 * <p>For example, a sensor with RAW10 Bayer output would use the
3087 * 10 most significant bits from each color channel.</p>
3088 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3089 *
3090 * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
3091 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003092 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07003093 public static final Key<int[]> SENSOR_TEST_PATTERN_DATA =
3094 new Key<int[]>("android.sensor.testPatternData", int[].class);
3095
3096 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08003097 * <p>When enabled, the sensor sends a test pattern instead of
3098 * doing a real exposure from the camera.</p>
3099 * <p>When a test pattern is enabled, all manual sensor controls specified
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003100 * by android.sensor.* will be ignored. All other controls should
Igor Murashkinc127f052014-01-17 18:06:02 -08003101 * work as normal.</p>
3102 * <p>For example, if manual flash is enabled, flash firing should still
3103 * occur (and that the test pattern remain unmodified, since the flash
3104 * would not actually affect it).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003105 * <p>Defaults to OFF.</p>
3106 * <p><b>Possible values:</b>
3107 * <ul>
3108 * <li>{@link #SENSOR_TEST_PATTERN_MODE_OFF OFF}</li>
3109 * <li>{@link #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR SOLID_COLOR}</li>
3110 * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS COLOR_BARS}</li>
3111 * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY COLOR_BARS_FADE_TO_GRAY}</li>
3112 * <li>{@link #SENSOR_TEST_PATTERN_MODE_PN9 PN9}</li>
3113 * <li>{@link #SENSOR_TEST_PATTERN_MODE_CUSTOM1 CUSTOM1}</li>
3114 * </ul></p>
3115 * <p><b>Available values for this device:</b><br>
3116 * {@link CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES android.sensor.availableTestPatternModes}</p>
Igor Murashkinc127f052014-01-17 18:06:02 -08003117 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003118 *
3119 * @see CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES
Igor Murashkinc127f052014-01-17 18:06:02 -08003120 * @see #SENSOR_TEST_PATTERN_MODE_OFF
3121 * @see #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR
3122 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS
3123 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY
3124 * @see #SENSOR_TEST_PATTERN_MODE_PN9
3125 * @see #SENSOR_TEST_PATTERN_MODE_CUSTOM1
3126 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003127 @PublicKey
Igor Murashkinc127f052014-01-17 18:06:02 -08003128 public static final Key<Integer> SENSOR_TEST_PATTERN_MODE =
3129 new Key<Integer>("android.sensor.testPatternMode", int.class);
3130
3131 /**
Zhijun He0bda31a2014-06-13 14:38:39 -07003132 * <p>Duration between the start of first row exposure
3133 * and the start of last row exposure.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003134 * <p>This is the exposure time skew between the first and last
3135 * row exposure start times. The first row and the last row are
3136 * the first and last rows inside of the
3137 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
Zhijun He0bda31a2014-06-13 14:38:39 -07003138 * <p>For typical camera sensors that use rolling shutters, this is also equivalent
3139 * to the frame readout time.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003140 * <p><b>Units</b>: Nanoseconds</p>
3141 * <p><b>Range of valid values:</b><br>
3142 * &gt;= 0 and &lt;
3143 * StreamConfigurationMap#getOutputMinFrameDuration(int, Size).</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003144 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3145 * <p><b>Limited capability</b> -
3146 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3147 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He0bda31a2014-06-13 14:38:39 -07003148 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003149 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He0bda31a2014-06-13 14:38:39 -07003150 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3151 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003152 @PublicKey
Zhijun He0bda31a2014-06-13 14:38:39 -07003153 public static final Key<Long> SENSOR_ROLLING_SHUTTER_SKEW =
3154 new Key<Long>("android.sensor.rollingShutterSkew", long.class);
3155
3156 /**
Zhijun Heba93fe62014-01-17 16:43:05 -08003157 * <p>Quality of lens shading correction applied
3158 * to the image data.</p>
3159 * <p>When set to OFF mode, no lens shading correction will be applied by the
3160 * camera device, and an identity lens shading map data will be provided
3161 * if <code>{@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} == ON</code>. For example, for lens
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003162 * shading map with size of <code>[ 4, 3 ]</code>,
3163 * the output {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap} for this case will be an identity
3164 * map shown below:</p>
Zhijun Heba93fe62014-01-17 16:43:05 -08003165 * <pre><code>[ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003166 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
3167 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
3168 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
3169 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
3170 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ]
Zhijun Heba93fe62014-01-17 16:43:05 -08003171 * </code></pre>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003172 * <p>When set to other modes, lens shading correction will be applied by the camera
3173 * device. Applications can request lens shading map data by setting
3174 * {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} to ON, and then the camera device will provide lens
3175 * shading map data in {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap}; the returned shading map
3176 * data will be the one applied by the camera device for this capture request.</p>
3177 * <p>The shading map data may depend on the auto-exposure (AE) and AWB statistics, therefore
3178 * the reliability of the map data may be affected by the AE and AWB algorithms. When AE and
3179 * AWB are in AUTO modes({@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF and {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} <code>!=</code>
3180 * OFF), to get best results, it is recommended that the applications wait for the AE and AWB
3181 * to be converged before using the returned shading map data.</p>
3182 * <p><b>Possible values:</b>
3183 * <ul>
3184 * <li>{@link #SHADING_MODE_OFF OFF}</li>
3185 * <li>{@link #SHADING_MODE_FAST FAST}</li>
3186 * <li>{@link #SHADING_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
3187 * </ul></p>
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003188 * <p><b>Available values for this device:</b><br>
3189 * {@link CameraCharacteristics#SHADING_AVAILABLE_MODES android.shading.availableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003190 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3191 * <p><b>Full capability</b> -
3192 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3193 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heba93fe62014-01-17 16:43:05 -08003194 *
Zhijun Hefa7c7552014-05-22 16:36:02 -07003195 * @see CaptureRequest#CONTROL_AE_MODE
3196 * @see CaptureRequest#CONTROL_AWB_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003197 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003198 * @see CameraCharacteristics#SHADING_AVAILABLE_MODES
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003199 * @see CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP
Zhijun Heba93fe62014-01-17 16:43:05 -08003200 * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
3201 * @see #SHADING_MODE_OFF
3202 * @see #SHADING_MODE_FAST
3203 * @see #SHADING_MODE_HIGH_QUALITY
Zhijun Heba93fe62014-01-17 16:43:05 -08003204 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003205 @PublicKey
Zhijun Heba93fe62014-01-17 16:43:05 -08003206 public static final Key<Integer> SHADING_MODE =
3207 new Key<Integer>("android.shading.mode", int.class);
3208
3209 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003210 * <p>Operating mode for the face detector
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003211 * unit.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08003212 * <p>Whether face detection is enabled, and whether it
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003213 * should output just the basic fields or the full set of
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003214 * fields.</p>
3215 * <p><b>Possible values:</b>
3216 * <ul>
3217 * <li>{@link #STATISTICS_FACE_DETECT_MODE_OFF OFF}</li>
3218 * <li>{@link #STATISTICS_FACE_DETECT_MODE_SIMPLE SIMPLE}</li>
3219 * <li>{@link #STATISTICS_FACE_DETECT_MODE_FULL FULL}</li>
3220 * </ul></p>
3221 * <p><b>Available values for this device:</b><br>
3222 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}</p>
3223 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003224 *
3225 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003226 * @see #STATISTICS_FACE_DETECT_MODE_OFF
3227 * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE
3228 * @see #STATISTICS_FACE_DETECT_MODE_FULL
3229 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003230 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003231 public static final Key<Integer> STATISTICS_FACE_DETECT_MODE =
3232 new Key<Integer>("android.statistics.faceDetectMode", int.class);
3233
3234 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003235 * <p>List of unique IDs for detected faces.</p>
3236 * <p>Each detected face is given a unique ID that is valid for as long as the face is visible
3237 * to the camera device. A face that leaves the field of view and later returns may be
3238 * assigned a new ID.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003239 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL
3240 * This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003241 *
3242 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003243 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003244 */
3245 public static final Key<int[]> STATISTICS_FACE_IDS =
3246 new Key<int[]>("android.statistics.faceIds", int[].class);
3247
3248 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003249 * <p>List of landmarks for detected
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003250 * faces.</p>
3251 * <p>The coordinate system is that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
3252 * <code>(0, 0)</code> being the top-left pixel of the active array.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003253 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL
3254 * This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003255 *
3256 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3257 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003258 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003259 */
3260 public static final Key<int[]> STATISTICS_FACE_LANDMARKS =
3261 new Key<int[]>("android.statistics.faceLandmarks", int[].class);
3262
3263 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003264 * <p>List of the bounding rectangles for detected
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003265 * faces.</p>
3266 * <p>The coordinate system is that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
3267 * <code>(0, 0)</code> being the top-left pixel of the active array.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003268 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} != OFF
3269 * This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003270 *
3271 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3272 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003273 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003274 */
3275 public static final Key<android.graphics.Rect[]> STATISTICS_FACE_RECTANGLES =
3276 new Key<android.graphics.Rect[]>("android.statistics.faceRectangles", android.graphics.Rect[].class);
3277
3278 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003279 * <p>List of the face confidence scores for
3280 * detected faces</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003281 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} != OFF.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003282 * <p><b>Range of valid values:</b><br>
3283 * 1-100</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003284 * <p>This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003285 *
3286 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003287 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003288 */
3289 public static final Key<byte[]> STATISTICS_FACE_SCORES =
3290 new Key<byte[]>("android.statistics.faceScores", byte[].class);
3291
3292 /**
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003293 * <p>List of the faces detected through camera face detection
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003294 * in this capture.</p>
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003295 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} <code>!=</code> OFF.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003296 * <p>This key is available on all devices.</p>
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003297 *
3298 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
3299 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003300 @PublicKey
3301 @SyntheticKey
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003302 public static final Key<android.hardware.camera2.params.Face[]> STATISTICS_FACES =
3303 new Key<android.hardware.camera2.params.Face[]>("android.statistics.faces", android.hardware.camera2.params.Face[].class);
3304
3305 /**
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003306 * <p>The shading map is a low-resolution floating-point map
3307 * that lists the coefficients used to correct for vignetting, for each
3308 * Bayer color channel.</p>
3309 * <p>The least shaded section of the image should have a gain factor
3310 * of 1; all other sections should have gains above 1.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003311 * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map
Igor Murashkinace5bf02013-12-10 17:36:40 -08003312 * must take into account the colorCorrection settings.</p>
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003313 * <p>The shading map is for the entire active pixel array, and is not
3314 * affected by the crop region specified in the request. Each shading map
3315 * entry is the value of the shading compensation map over a specific
3316 * pixel on the sensor. Specifically, with a (N x M) resolution shading
3317 * map, and an active pixel array size (W x H), shading map entry
3318 * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at
3319 * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
3320 * The map is assumed to be bilinearly interpolated between the sample points.</p>
3321 * <p>The channel order is [R, Geven, Godd, B], where Geven is the green
3322 * channel for the even rows of a Bayer pattern, and Godd is the odd rows.
Ruben Brunk57493682014-05-27 18:58:08 -07003323 * The shading map is stored in a fully interleaved format.</p>
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003324 * <p>The shading map should have on the order of 30-40 rows and columns,
3325 * and must be smaller than 64x64.</p>
3326 * <p>As an example, given a very small map defined as:</p>
Ruben Brunk57493682014-05-27 18:58:08 -07003327 * <pre><code>width,height = [ 4, 3 ]
3328 * values =
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003329 * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2,
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003330 * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3,
3331 * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0,
3332 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2,
3333 * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2,
3334 * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ]
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003335 * </code></pre>
3336 * <p>The low-resolution scaling map images for each channel are
3337 * (displayed using nearest-neighbor interpolation):</p>
3338 * <p><img alt="Red lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" />
3339 * <img alt="Green (even rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" />
3340 * <img alt="Green (odd rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" />
3341 * <img alt="Blue lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/blue_shading.png" /></p>
3342 * <p>As a visualization only, inverting the full-color map to recover an
3343 * image of a gray wall (using bicubic interpolation for visual quality) as captured by the sensor gives:</p>
3344 * <p><img alt="Image of a uniform white wall (inverse shading map)" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/inv_shading.png" /></p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003345 * <p><b>Range of valid values:</b><br>
3346 * Each gain factor is &gt;= 1</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003347 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3348 * <p><b>Full capability</b> -
3349 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3350 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003351 *
Zhijun He5f2a47f2014-01-16 15:44:41 -08003352 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003353 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk57493682014-05-27 18:58:08 -07003354 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003355 @PublicKey
Ruben Brunk57493682014-05-27 18:58:08 -07003356 public static final Key<android.hardware.camera2.params.LensShadingMap> STATISTICS_LENS_SHADING_CORRECTION_MAP =
3357 new Key<android.hardware.camera2.params.LensShadingMap>("android.statistics.lensShadingCorrectionMap", android.hardware.camera2.params.LensShadingMap.class);
3358
3359 /**
3360 * <p>The shading map is a low-resolution floating-point map
3361 * that lists the coefficients used to correct for vignetting, for each
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003362 * Bayer color channel of RAW image data.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07003363 * <p>The least shaded section of the image should have a gain factor
3364 * of 1; all other sections should have gains above 1.</p>
3365 * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map
3366 * must take into account the colorCorrection settings.</p>
3367 * <p>The shading map is for the entire active pixel array, and is not
3368 * affected by the crop region specified in the request. Each shading map
3369 * entry is the value of the shading compensation map over a specific
3370 * pixel on the sensor. Specifically, with a (N x M) resolution shading
3371 * map, and an active pixel array size (W x H), shading map entry
3372 * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at
3373 * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
3374 * The map is assumed to be bilinearly interpolated between the sample points.</p>
3375 * <p>The channel order is [R, Geven, Godd, B], where Geven is the green
3376 * channel for the even rows of a Bayer pattern, and Godd is the odd rows.
3377 * The shading map is stored in a fully interleaved format, and its size
3378 * is provided in the camera static metadata by android.lens.info.shadingMapSize.</p>
3379 * <p>The shading map should have on the order of 30-40 rows and columns,
3380 * and must be smaller than 64x64.</p>
3381 * <p>As an example, given a very small map defined as:</p>
3382 * <pre><code>android.lens.info.shadingMapSize = [ 4, 3 ]
3383 * android.statistics.lensShadingMap =
3384 * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2,
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003385 * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3,
3386 * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0,
3387 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2,
3388 * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2,
3389 * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ]
Ruben Brunk57493682014-05-27 18:58:08 -07003390 * </code></pre>
3391 * <p>The low-resolution scaling map images for each channel are
3392 * (displayed using nearest-neighbor interpolation):</p>
3393 * <p><img alt="Red lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" />
3394 * <img alt="Green (even rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" />
3395 * <img alt="Green (odd rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" />
3396 * <img alt="Blue lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/blue_shading.png" /></p>
3397 * <p>As a visualization only, inverting the full-color map to recover an
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003398 * image of a gray wall (using bicubic interpolation for visual quality)
3399 * as captured by the sensor gives:</p>
Ruben Brunk57493682014-05-27 18:58:08 -07003400 * <p><img alt="Image of a uniform white wall (inverse shading map)" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/inv_shading.png" /></p>
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003401 * <p>Note that the RAW image data might be subject to lens shading
3402 * correction not reported on this map. Query
3403 * {@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied} to see if RAW image data has subject
3404 * to lens shading correction. If {@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied}
3405 * is TRUE, the RAW image data is subject to partial or full lens shading
3406 * correction. In the case full lens shading correction is applied to RAW
3407 * images, the gain factor map reported in this key will contain all 1.0 gains.
3408 * In other words, the map reported in this key is the remaining lens shading
3409 * that needs to be applied on the RAW image to get images without lens shading
3410 * artifacts. See {@link CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_RAW android.request.maxNumOutputRaw} for a list of RAW image
3411 * formats.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003412 * <p><b>Range of valid values:</b><br>
3413 * Each gain factor is &gt;= 1</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003414 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3415 * <p><b>Full capability</b> -
3416 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3417 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk57493682014-05-27 18:58:08 -07003418 *
3419 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003420 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003421 * @see CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_RAW
3422 * @see CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED
Ruben Brunk57493682014-05-27 18:58:08 -07003423 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003424 */
3425 public static final Key<float[]> STATISTICS_LENS_SHADING_MAP =
3426 new Key<float[]>("android.statistics.lensShadingMap", float[].class);
3427
3428 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003429 * <p>The best-fit color channel gains calculated
Zhijun Hecc28a412014-02-24 15:11:23 -08003430 * by the camera device's statistics units for the current output frame.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08003431 * <p>This may be different than the gains used for this frame,
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003432 * since statistics processing on data from a new frame
3433 * typically completes after the transform has already been
Igor Murashkinace5bf02013-12-10 17:36:40 -08003434 * applied to that frame.</p>
3435 * <p>The 4 channel gains are defined in Bayer domain,
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003436 * see {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} for details.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003437 * <p>This value should always be calculated by the auto-white balance (AWB) block,
Igor Murashkinace5bf02013-12-10 17:36:40 -08003438 * regardless of the android.control.* current values.</p>
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08003439 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003440 *
3441 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Igor Murashkin9c595172014-05-12 13:56:20 -07003442 * @deprecated
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08003443 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003444 */
Igor Murashkin9c595172014-05-12 13:56:20 -07003445 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003446 public static final Key<float[]> STATISTICS_PREDICTED_COLOR_GAINS =
3447 new Key<float[]>("android.statistics.predictedColorGains", float[].class);
3448
3449 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003450 * <p>The best-fit color transform matrix estimate
Zhijun Hecc28a412014-02-24 15:11:23 -08003451 * calculated by the camera device's statistics units for the current
3452 * output frame.</p>
3453 * <p>The camera device will provide the estimate from its
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003454 * statistics unit on the white balance transforms to use
Zhijun Hecc28a412014-02-24 15:11:23 -08003455 * for the next frame. These are the values the camera device believes
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003456 * are the best fit for the current output frame. This may
3457 * be different than the transform used for this frame, since
3458 * statistics processing on data from a new frame typically
3459 * completes after the transform has already been applied to
Igor Murashkinace5bf02013-12-10 17:36:40 -08003460 * that frame.</p>
3461 * <p>These estimates must be provided for all frames, even if
3462 * capture settings and color transforms are set by the application.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003463 * <p>This value should always be calculated by the auto-white balance (AWB) block,
Igor Murashkinace5bf02013-12-10 17:36:40 -08003464 * regardless of the android.control.* current values.</p>
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08003465 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07003466 * @deprecated
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08003467 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003468 */
Igor Murashkin9c595172014-05-12 13:56:20 -07003469 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003470 public static final Key<Rational[]> STATISTICS_PREDICTED_COLOR_TRANSFORM =
3471 new Key<Rational[]>("android.statistics.predictedColorTransform", Rational[].class);
3472
3473 /**
Zhijun He208fb6c2014-02-03 13:09:06 -08003474 * <p>The camera device estimated scene illumination lighting
3475 * frequency.</p>
3476 * <p>Many light sources, such as most fluorescent lights, flicker at a rate
3477 * that depends on the local utility power standards. This flicker must be
3478 * accounted for by auto-exposure routines to avoid artifacts in captured images.
3479 * The camera device uses this entry to tell the application what the scene
3480 * illuminant frequency is.</p>
3481 * <p>When manual exposure control is enabled
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003482 * (<code>{@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} == OFF</code> or <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} ==
3483 * OFF</code>), the {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} doesn't perform
3484 * antibanding, and the application can ensure it selects
3485 * exposure times that do not cause banding issues by looking
3486 * into this metadata field. See
3487 * {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} for more details.</p>
3488 * <p>Reports NONE if there doesn't appear to be flickering illumination.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003489 * <p><b>Possible values:</b>
3490 * <ul>
3491 * <li>{@link #STATISTICS_SCENE_FLICKER_NONE NONE}</li>
3492 * <li>{@link #STATISTICS_SCENE_FLICKER_50HZ 50HZ}</li>
3493 * <li>{@link #STATISTICS_SCENE_FLICKER_60HZ 60HZ}</li>
3494 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003495 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3496 * <p><b>Full capability</b> -
3497 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3498 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He208fb6c2014-02-03 13:09:06 -08003499 *
3500 * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
3501 * @see CaptureRequest#CONTROL_AE_MODE
3502 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003503 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003504 * @see #STATISTICS_SCENE_FLICKER_NONE
3505 * @see #STATISTICS_SCENE_FLICKER_50HZ
3506 * @see #STATISTICS_SCENE_FLICKER_60HZ
3507 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003508 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003509 public static final Key<Integer> STATISTICS_SCENE_FLICKER =
3510 new Key<Integer>("android.statistics.sceneFlicker", int.class);
3511
3512 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003513 * <p>Operating mode for hot pixel map generation.</p>
3514 * <p>If set to <code>true</code>, a hot pixel map is returned in {@link CaptureResult#STATISTICS_HOT_PIXEL_MAP android.statistics.hotPixelMap}.
3515 * If set to <code>false</code>, no hot pixel map will be returned.</p>
3516 * <p><b>Range of valid values:</b><br>
3517 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES android.statistics.info.availableHotPixelMapModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003518 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08003519 *
3520 * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP
3521 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES
3522 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003523 @PublicKey
Ruben Brunk9d454fd2014-03-04 14:11:52 -08003524 public static final Key<Boolean> STATISTICS_HOT_PIXEL_MAP_MODE =
3525 new Key<Boolean>("android.statistics.hotPixelMapMode", boolean.class);
3526
3527 /**
3528 * <p>List of <code>(x, y)</code> coordinates of hot/defective pixels on the sensor.</p>
3529 * <p>A coordinate <code>(x, y)</code> must lie between <code>(0, 0)</code>, and
3530 * <code>(width - 1, height - 1)</code> (inclusive), which are the top-left and
3531 * bottom-right of the pixel array, respectively. The width and
3532 * height dimensions are given in {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.
3533 * This may include hot pixels that lie outside of the active array
3534 * bounds given by {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003535 * <p><b>Range of valid values:</b><br></p>
3536 * <p>n &lt;= number of pixels on the sensor.
3537 * The <code>(x, y)</code> coordinates must be bounded by
3538 * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003539 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08003540 *
3541 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3542 * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
3543 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003544 @PublicKey
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003545 public static final Key<android.graphics.Point[]> STATISTICS_HOT_PIXEL_MAP =
3546 new Key<android.graphics.Point[]>("android.statistics.hotPixelMap", android.graphics.Point[].class);
Ruben Brunk9d454fd2014-03-04 14:11:52 -08003547
3548 /**
Zhijun He379af012014-05-06 11:54:54 -07003549 * <p>Whether the camera device will output the lens
3550 * shading map in output result metadata.</p>
3551 * <p>When set to ON,
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003552 * android.statistics.lensShadingMap will be provided in
Zhijun He379af012014-05-06 11:54:54 -07003553 * the output result metadata.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003554 * <p>ON is always supported on devices with the RAW capability.</p>
3555 * <p><b>Possible values:</b>
3556 * <ul>
3557 * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_OFF OFF}</li>
3558 * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_ON ON}</li>
3559 * </ul></p>
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003560 * <p><b>Available values for this device:</b><br>
3561 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES android.statistics.info.availableLensShadingMapModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003562 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3563 * <p><b>Full capability</b> -
3564 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3565 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3566 *
3567 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003568 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES
Zhijun He379af012014-05-06 11:54:54 -07003569 * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF
3570 * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON
3571 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003572 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07003573 public static final Key<Integer> STATISTICS_LENS_SHADING_MAP_MODE =
3574 new Key<Integer>("android.statistics.lensShadingMapMode", int.class);
3575
3576 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003577 * <p>Tonemapping / contrast / gamma curve for the blue
Igor Murashkine0060932014-01-17 17:24:11 -08003578 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
3579 * CONTRAST_CURVE.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003580 * <p>See android.tonemap.curveRed for more details.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003581 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3582 * <p><b>Full capability</b> -
3583 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3584 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003585 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003586 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He5f2a47f2014-01-16 15:44:41 -08003587 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003588 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003589 */
Zhijun He3ffd7052013-08-19 15:45:08 -07003590 public static final Key<float[]> TONEMAP_CURVE_BLUE =
3591 new Key<float[]>("android.tonemap.curveBlue", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003592
3593 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003594 * <p>Tonemapping / contrast / gamma curve for the green
Igor Murashkine0060932014-01-17 17:24:11 -08003595 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
3596 * CONTRAST_CURVE.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003597 * <p>See android.tonemap.curveRed for more details.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003598 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3599 * <p><b>Full capability</b> -
3600 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3601 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003602 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003603 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He5f2a47f2014-01-16 15:44:41 -08003604 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003605 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003606 */
Zhijun He3ffd7052013-08-19 15:45:08 -07003607 public static final Key<float[]> TONEMAP_CURVE_GREEN =
3608 new Key<float[]>("android.tonemap.curveGreen", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003609
3610 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003611 * <p>Tonemapping / contrast / gamma curve for the red
Igor Murashkine0060932014-01-17 17:24:11 -08003612 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
3613 * CONTRAST_CURVE.</p>
3614 * <p>Each channel's curve is defined by an array of control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003615 * <pre><code>android.tonemap.curveRed =
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003616 * [ P0in, P0out, P1in, P1out, P2in, P2out, P3in, P3out, ..., PNin, PNout ]
Zhijun He870922b2014-02-15 21:47:51 -08003617 * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003618 * <p>These are sorted in order of increasing <code>Pin</code>; it is
3619 * required that input values 0.0 and 1.0 are included in the list to
Igor Murashkine0060932014-01-17 17:24:11 -08003620 * define a complete mapping. For input values between control points,
3621 * the camera device must linearly interpolate between the control
3622 * points.</p>
3623 * <p>Each curve can have an independent number of points, and the number
3624 * of points can be less than max (that is, the request doesn't have to
3625 * always provide a curve with number of points equivalent to
3626 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
3627 * <p>A few examples, and their corresponding graphical mappings; these
3628 * only specify the red channel and the precision is limited to 4
3629 * digits, for conciseness.</p>
3630 * <p>Linear mapping:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003631 * <pre><code>android.tonemap.curveRed = [ 0, 0, 1.0, 1.0 ]
Igor Murashkine0060932014-01-17 17:24:11 -08003632 * </code></pre>
3633 * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p>
3634 * <p>Invert mapping:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003635 * <pre><code>android.tonemap.curveRed = [ 0, 1.0, 1.0, 0 ]
Igor Murashkine0060932014-01-17 17:24:11 -08003636 * </code></pre>
3637 * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p>
3638 * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003639 * <pre><code>android.tonemap.curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003640 * 0.0000, 0.0000, 0.0667, 0.2920, 0.1333, 0.4002, 0.2000, 0.4812,
3641 * 0.2667, 0.5484, 0.3333, 0.6069, 0.4000, 0.6594, 0.4667, 0.7072,
3642 * 0.5333, 0.7515, 0.6000, 0.7928, 0.6667, 0.8317, 0.7333, 0.8685,
3643 * 0.8000, 0.9035, 0.8667, 0.9370, 0.9333, 0.9691, 1.0000, 1.0000 ]
Igor Murashkine0060932014-01-17 17:24:11 -08003644 * </code></pre>
3645 * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p>
3646 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003647 * <pre><code>android.tonemap.curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003648 * 0.0000, 0.0000, 0.0667, 0.2864, 0.1333, 0.4007, 0.2000, 0.4845,
3649 * 0.2667, 0.5532, 0.3333, 0.6125, 0.4000, 0.6652, 0.4667, 0.7130,
3650 * 0.5333, 0.7569, 0.6000, 0.7977, 0.6667, 0.8360, 0.7333, 0.8721,
3651 * 0.8000, 0.9063, 0.8667, 0.9389, 0.9333, 0.9701, 1.0000, 1.0000 ]
Igor Murashkine0060932014-01-17 17:24:11 -08003652 * </code></pre>
3653 * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003654 * <p><b>Range of valid values:</b><br>
3655 * 0-1 on both input and output coordinates, normalized
3656 * as a floating-point value such that 0 == black and 1 == white.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003657 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3658 * <p><b>Full capability</b> -
3659 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3660 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003661 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003662 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Igor Murashkine0060932014-01-17 17:24:11 -08003663 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003664 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003665 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003666 */
3667 public static final Key<float[]> TONEMAP_CURVE_RED =
3668 new Key<float[]>("android.tonemap.curveRed", float[].class);
3669
3670 /**
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003671 * <p>Tonemapping / contrast / gamma curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode}
3672 * is CONTRAST_CURVE.</p>
3673 * <p>The tonemapCurve consist of three curves for each of red, green, and blue
3674 * channels respectively. The following example uses the red channel as an
3675 * example. The same logic applies to green and blue channel.
3676 * Each channel's curve is defined by an array of control points:</p>
3677 * <pre><code>curveRed =
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003678 * [ P0(in, out), P1(in, out), P2(in, out), P3(in, out), ..., PN(in, out) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003679 * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
3680 * <p>These are sorted in order of increasing <code>Pin</code>; it is always
3681 * guaranteed that input values 0.0 and 1.0 are included in the list to
3682 * define a complete mapping. For input values between control points,
3683 * the camera device must linearly interpolate between the control
3684 * points.</p>
3685 * <p>Each curve can have an independent number of points, and the number
3686 * of points can be less than max (that is, the request doesn't have to
3687 * always provide a curve with number of points equivalent to
3688 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
3689 * <p>A few examples, and their corresponding graphical mappings; these
3690 * only specify the red channel and the precision is limited to 4
3691 * digits, for conciseness.</p>
3692 * <p>Linear mapping:</p>
3693 * <pre><code>curveRed = [ (0, 0), (1.0, 1.0) ]
3694 * </code></pre>
3695 * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p>
3696 * <p>Invert mapping:</p>
3697 * <pre><code>curveRed = [ (0, 1.0), (1.0, 0) ]
3698 * </code></pre>
3699 * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p>
3700 * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
3701 * <pre><code>curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003702 * (0.0000, 0.0000), (0.0667, 0.2920), (0.1333, 0.4002), (0.2000, 0.4812),
3703 * (0.2667, 0.5484), (0.3333, 0.6069), (0.4000, 0.6594), (0.4667, 0.7072),
3704 * (0.5333, 0.7515), (0.6000, 0.7928), (0.6667, 0.8317), (0.7333, 0.8685),
3705 * (0.8000, 0.9035), (0.8667, 0.9370), (0.9333, 0.9691), (1.0000, 1.0000) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003706 * </code></pre>
3707 * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p>
3708 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
3709 * <pre><code>curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003710 * (0.0000, 0.0000), (0.0667, 0.2864), (0.1333, 0.4007), (0.2000, 0.4845),
3711 * (0.2667, 0.5532), (0.3333, 0.6125), (0.4000, 0.6652), (0.4667, 0.7130),
3712 * (0.5333, 0.7569), (0.6000, 0.7977), (0.6667, 0.8360), (0.7333, 0.8721),
3713 * (0.8000, 0.9063), (0.8667, 0.9389), (0.9333, 0.9701), (1.0000, 1.0000) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003714 * </code></pre>
3715 * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003716 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3717 * <p><b>Full capability</b> -
3718 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3719 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003720 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003721 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003722 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
3723 * @see CaptureRequest#TONEMAP_MODE
3724 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003725 @PublicKey
3726 @SyntheticKey
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003727 public static final Key<android.hardware.camera2.params.TonemapCurve> TONEMAP_CURVE =
3728 new Key<android.hardware.camera2.params.TonemapCurve>("android.tonemap.curve", android.hardware.camera2.params.TonemapCurve.class);
3729
3730 /**
Igor Murashkine0060932014-01-17 17:24:11 -08003731 * <p>High-level global contrast/gamma/tonemapping control.</p>
3732 * <p>When switching to an application-defined contrast curve by setting
3733 * {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} to CONTRAST_CURVE, the curve is defined
3734 * per-channel with a set of <code>(in, out)</code> points that specify the
3735 * mapping from input high-bit-depth pixel value to the output
3736 * low-bit-depth value. Since the actual pixel ranges of both input
3737 * and output may change depending on the camera pipeline, the values
3738 * are specified by normalized floating-point numbers.</p>
3739 * <p>More-complex color mapping operations such as 3D color look-up
3740 * tables, selective chroma enhancement, or other non-linear color
3741 * transforms will be disabled when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
3742 * CONTRAST_CURVE.</p>
3743 * <p>When using either FAST or HIGH_QUALITY, the camera device will
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003744 * emit its own tonemap curve in {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}.
Igor Murashkine0060932014-01-17 17:24:11 -08003745 * These values are always available, and as close as possible to the
3746 * actually used nonlinear/nonglobal transforms.</p>
Zhijun Hefa7c7552014-05-22 16:36:02 -07003747 * <p>If a request is sent with CONTRAST_CURVE with the camera device's
Igor Murashkine0060932014-01-17 17:24:11 -08003748 * provided curve in FAST or HIGH_QUALITY, the image's tonemap will be
3749 * roughly the same.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003750 * <p><b>Possible values:</b>
3751 * <ul>
3752 * <li>{@link #TONEMAP_MODE_CONTRAST_CURVE CONTRAST_CURVE}</li>
3753 * <li>{@link #TONEMAP_MODE_FAST FAST}</li>
3754 * <li>{@link #TONEMAP_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08003755 * <li>{@link #TONEMAP_MODE_GAMMA_VALUE GAMMA_VALUE}</li>
3756 * <li>{@link #TONEMAP_MODE_PRESET_CURVE PRESET_CURVE}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003757 * </ul></p>
3758 * <p><b>Available values for this device:</b><br>
3759 * {@link CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES android.tonemap.availableToneMapModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003760 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3761 * <p><b>Full capability</b> -
3762 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3763 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08003764 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003765 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -08003766 * @see CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003767 * @see CaptureRequest#TONEMAP_CURVE
Igor Murashkine0060932014-01-17 17:24:11 -08003768 * @see CaptureRequest#TONEMAP_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003769 * @see #TONEMAP_MODE_CONTRAST_CURVE
3770 * @see #TONEMAP_MODE_FAST
3771 * @see #TONEMAP_MODE_HIGH_QUALITY
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08003772 * @see #TONEMAP_MODE_GAMMA_VALUE
3773 * @see #TONEMAP_MODE_PRESET_CURVE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003774 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003775 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003776 public static final Key<Integer> TONEMAP_MODE =
3777 new Key<Integer>("android.tonemap.mode", int.class);
3778
3779 /**
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08003780 * <p>Tonemapping curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
3781 * GAMMA_VALUE</p>
3782 * <p>The tonemap curve will be defined the following formula:
3783 * * OUT = pow(IN, 1.0 / gamma)
3784 * where IN and OUT is the input pixel value scaled to range [0.0, 1.0],
3785 * pow is the power function and gamma is the gamma value specified by this
3786 * key.</p>
3787 * <p>The same curve will be applied to all color channels. The camera device
3788 * may clip the input gamma value to its supported range. The actual applied
3789 * value will be returned in capture result.</p>
3790 * <p>The valid range of gamma value varies on different devices, but values
3791 * within [1.0, 5.0] are guaranteed not to be clipped.</p>
3792 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3793 *
3794 * @see CaptureRequest#TONEMAP_MODE
3795 */
3796 @PublicKey
3797 public static final Key<Float> TONEMAP_GAMMA =
3798 new Key<Float>("android.tonemap.gamma", float.class);
3799
3800 /**
3801 * <p>Tonemapping curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
3802 * PRESET_CURVE</p>
3803 * <p>The tonemap curve will be defined by specified standard.</p>
3804 * <p>sRGB (approximated by 16 control points):</p>
3805 * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p>
3806 * <p>Rec. 709 (approximated by 16 control points):</p>
3807 * <p><img alt="Rec. 709 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/rec709_tonemap.png" /></p>
3808 * <p>Note that above figures show a 16 control points approximation of preset
3809 * curves. Camera devices may apply a different approximation to the curve.</p>
3810 * <p><b>Possible values:</b>
3811 * <ul>
3812 * <li>{@link #TONEMAP_PRESET_CURVE_SRGB SRGB}</li>
3813 * <li>{@link #TONEMAP_PRESET_CURVE_REC709 REC709}</li>
3814 * </ul></p>
3815 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3816 *
3817 * @see CaptureRequest#TONEMAP_MODE
3818 * @see #TONEMAP_PRESET_CURVE_SRGB
3819 * @see #TONEMAP_PRESET_CURVE_REC709
3820 */
3821 @PublicKey
3822 public static final Key<Integer> TONEMAP_PRESET_CURVE =
3823 new Key<Integer>("android.tonemap.presetCurve", int.class);
3824
3825 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003826 * <p>This LED is nominally used to indicate to the user
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003827 * that the camera is powered on and may be streaming images back to the
3828 * Application Processor. In certain rare circumstances, the OS may
3829 * disable this when video is processed locally and not transmitted to
Igor Murashkinace5bf02013-12-10 17:36:40 -08003830 * any untrusted applications.</p>
3831 * <p>In particular, the LED <em>must</em> always be on when the data could be
3832 * transmitted off the device. The LED <em>should</em> always be on whenever
3833 * data is stored locally on the device.</p>
3834 * <p>The LED <em>may</em> be off if a trusted application is using the data that
3835 * doesn't violate the above rules.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003836 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003837 * @hide
3838 */
3839 public static final Key<Boolean> LED_TRANSMIT =
3840 new Key<Boolean>("android.led.transmit", boolean.class);
3841
3842 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003843 * <p>Whether black-level compensation is locked
Eino-Ville Talvala0956af52013-12-26 13:19:10 -08003844 * to its current values, or is free to vary.</p>
3845 * <p>Whether the black level offset was locked for this frame. Should be
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003846 * 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 -08003847 * a change in other capture settings forced the camera device to
3848 * perform a black level reset.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003849 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3850 * <p><b>Full capability</b> -
3851 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3852 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003853 *
3854 * @see CaptureRequest#BLACK_LEVEL_LOCK
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003855 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003856 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003857 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003858 public static final Key<Boolean> BLACK_LEVEL_LOCK =
3859 new Key<Boolean>("android.blackLevel.lock", boolean.class);
3860
Igor Murashkin3865a842014-01-17 18:18:39 -08003861 /**
3862 * <p>The frame number corresponding to the last request
3863 * with which the output result (metadata + buffers) has been fully
3864 * synchronized.</p>
3865 * <p>When a request is submitted to the camera device, there is usually a
3866 * delay of several frames before the controls get applied. A camera
3867 * device may either choose to account for this delay by implementing a
3868 * pipeline and carefully submit well-timed atomic control updates, or
3869 * it may start streaming control changes that span over several frame
3870 * boundaries.</p>
3871 * <p>In the latter case, whenever a request's settings change relative to
3872 * the previous submitted request, the full set of changes may take
3873 * multiple frame durations to fully take effect. Some settings may
3874 * take effect sooner (in less frame durations) than others.</p>
3875 * <p>While a set of control changes are being propagated, this value
3876 * will be CONVERGING.</p>
3877 * <p>Once it is fully known that a set of control changes have been
3878 * finished propagating, and the resulting updated control settings
3879 * have been read back by the camera device, this value will be set
3880 * to a non-negative frame number (corresponding to the request to
3881 * which the results have synchronized to).</p>
3882 * <p>Older camera device implementations may not have a way to detect
3883 * when all camera controls have been applied, and will always set this
3884 * value to UNKNOWN.</p>
3885 * <p>FULL capability devices will always have this value set to the
3886 * frame number of the request corresponding to this result.</p>
3887 * <p><em>Further details</em>:</p>
3888 * <ul>
3889 * <li>Whenever a request differs from the last request, any future
3890 * results not yet returned may have this value set to CONVERGING (this
3891 * could include any in-progress captures not yet returned by the camera
3892 * device, for more details see pipeline considerations below).</li>
3893 * <li>Submitting a series of multiple requests that differ from the
3894 * previous request (e.g. r1, r2, r3 s.t. r1 != r2 != r3)
3895 * moves the new synchronization frame to the last non-repeating
3896 * request (using the smallest frame number from the contiguous list of
3897 * repeating requests).</li>
3898 * <li>Submitting the same request repeatedly will not change this value
3899 * to CONVERGING, if it was already a non-negative value.</li>
3900 * <li>When this value changes to non-negative, that means that all of the
3901 * metadata controls from the request have been applied, all of the
3902 * metadata controls from the camera device have been read to the
3903 * updated values (into the result), and all of the graphics buffers
3904 * corresponding to this result are also synchronized to the request.</li>
3905 * </ul>
3906 * <p><em>Pipeline considerations</em>:</p>
3907 * <p>Submitting a request with updated controls relative to the previously
3908 * submitted requests may also invalidate the synchronization state
3909 * of all the results corresponding to currently in-flight requests.</p>
3910 * <p>In other words, results for this current request and up to
3911 * {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} prior requests may have their
3912 * android.sync.frameNumber change to CONVERGING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003913 * <p><b>Possible values:</b>
3914 * <ul>
3915 * <li>{@link #SYNC_FRAME_NUMBER_CONVERGING CONVERGING}</li>
3916 * <li>{@link #SYNC_FRAME_NUMBER_UNKNOWN UNKNOWN}</li>
3917 * </ul></p>
3918 * <p><b>Available values for this device:</b><br>
3919 * Either a non-negative value corresponding to a
3920 * <code>frame_number</code>, or one of the two enums (CONVERGING / UNKNOWN).</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003921 * <p>This key is available on all devices.</p>
Igor Murashkin3865a842014-01-17 18:18:39 -08003922 *
3923 * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
3924 * @see #SYNC_FRAME_NUMBER_CONVERGING
3925 * @see #SYNC_FRAME_NUMBER_UNKNOWN
3926 * @hide
3927 */
Zhijun He4f91e2a2014-04-17 13:20:21 -07003928 public static final Key<Long> SYNC_FRAME_NUMBER =
3929 new Key<Long>("android.sync.frameNumber", long.class);
Igor Murashkin3865a842014-01-17 18:18:39 -08003930
Zhijun He0e99c222015-01-29 15:26:05 -08003931 /**
3932 * <p>The amount of exposure time increase factor applied to the original output
3933 * frame by the application processing before sending for reprocessing.</p>
3934 * <p>This is optional, and will be supported if the camera device supports YUV_REPROCESSING
3935 * capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains YUV_REPROCESSING).</p>
3936 * <p>For some YUV reprocessing use cases, the application may choose to filter the original
3937 * output frames to effectively reduce the noise to the same level as a frame that was
3938 * captured with longer exposure time. To be more specific, assuming the original captured
3939 * images were captured with a sensitivity of S and an exposure time of T, the model in
3940 * the camera device is that the amount of noise in the image would be approximately what
3941 * would be expected if the original capture parameters had been a sensitivity of
3942 * S/effectiveExposureFactor and an exposure time of T*effectiveExposureFactor, rather
3943 * than S and T respectively. If the captured images were processed by the application
3944 * before being sent for reprocessing, then the application may have used image processing
3945 * algorithms and/or multi-frame image fusion to reduce the noise in the
3946 * application-processed images (input images). By using the effectiveExposureFactor
3947 * control, the application can communicate to the camera device the actual noise level
3948 * improvement in the application-processed image. With this information, the camera
3949 * device can select appropriate noise reduction and edge enhancement parameters to avoid
3950 * excessive noise reduction ({@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode}) and insufficient edge
3951 * enhancement ({@link CaptureRequest#EDGE_MODE android.edge.mode}) being applied to the reprocessed frames.</p>
3952 * <p>For example, for multi-frame image fusion use case, the application may fuse
3953 * multiple output frames together to a final frame for reprocessing. When N image are
3954 * fused into 1 image for reprocessing, the exposure time increase factor could be up to
3955 * square root of N (based on a simple photon shot noise model). The camera device will
3956 * adjust the reprocessing noise reduction and edge enhancement parameters accordingly to
3957 * produce the best quality images.</p>
3958 * <p>This is relative factor, 1.0 indicates the application hasn't processed the input
3959 * buffer in a way that affects its effective exposure time.</p>
3960 * <p>This control is only effective for YUV reprocessing capture request. For noise
3961 * reduction reprocessing, it is only effective when <code>{@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode} != OFF</code>.
3962 * Similarly, for edge enhancement reprocessing, it is only effective when
3963 * <code>{@link CaptureRequest#EDGE_MODE android.edge.mode} != OFF</code>.</p>
3964 * <p><b>Units</b>: Relative exposure time increase factor.</p>
3965 * <p><b>Range of valid values:</b><br>
3966 * &gt;= 1.0</p>
3967 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3968 *
3969 * @see CaptureRequest#EDGE_MODE
3970 * @see CaptureRequest#NOISE_REDUCTION_MODE
3971 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
3972 */
3973 @PublicKey
3974 public static final Key<Float> REPROCESS_EFFECTIVE_EXPOSURE_FACTOR =
3975 new Key<Float>("android.reprocess.effectiveExposureFactor", float.class);
3976
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003977 /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
3978 * End generated code
3979 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
Igor Murashkin6c76f582014-07-15 17:19:49 -07003980
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003981
3982
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08003983}