blob: d208649f3edd6243f5402d4fe0d921639b378b51 [file] [log] [blame]
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08001/*
2 * Copyright (C) 2012 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Eino-Ville Talvala2f1a2e42013-07-25 17:12:05 -070017package android.hardware.camera2;
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080018
Eino-Ville Talvala70c22072013-08-27 12:09:04 -070019import android.hardware.camera2.impl.CameraMetadataNative;
Igor Murashkinbdf366c2014-07-25 16:54:20 -070020import android.hardware.camera2.impl.CaptureResultExtras;
Igor Murashkin6c76f582014-07-15 17:19:49 -070021import android.hardware.camera2.impl.PublicKey;
22import android.hardware.camera2.impl.SyntheticKey;
Igor Murashkind6d65152014-05-19 16:31:02 -070023import android.hardware.camera2.utils.TypeReference;
24import android.util.Log;
Igor Murashkin72f9f0a2014-05-14 15:46:10 -070025import android.util.Rational;
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080026
Igor Murashkind6d65152014-05-19 16:31:02 -070027import java.util.List;
28
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080029/**
Igor Murashkindb075af2014-05-21 10:07:08 -070030 * <p>The subset of the results of a single image capture from the image sensor.</p>
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080031 *
Igor Murashkindb075af2014-05-21 10:07:08 -070032 * <p>Contains a subset of the final configuration for the capture hardware (sensor, lens,
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080033 * flash), the processing pipeline, the control algorithms, and the output
34 * buffers.</p>
35 *
36 * <p>CaptureResults are produced by a {@link CameraDevice} after processing a
37 * {@link CaptureRequest}. All properties listed for capture requests can also
38 * be queried on the capture result, to determine the final values used for
39 * capture. The result also includes additional metadata about the state of the
40 * camera device during the capture.</p>
41 *
Igor Murashkindb075af2014-05-21 10:07:08 -070042 * <p>Not all properties returned by {@link CameraCharacteristics#getAvailableCaptureResultKeys()}
43 * are necessarily available. Some results are {@link CaptureResult partial} and will
44 * not have every key set. Only {@link TotalCaptureResult total} results are guaranteed to have
45 * every key available that was enabled by the request.</p>
46 *
47 * <p>{@link CaptureResult} objects are immutable.</p>
Ruben Brunkf967a542014-04-28 16:31:11 -070048 *
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080049 */
Igor Murashkindb075af2014-05-21 10:07:08 -070050public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> {
Igor Murashkind6d65152014-05-19 16:31:02 -070051
52 private static final String TAG = "CaptureResult";
53 private static final boolean VERBOSE = false;
54
55 /**
56 * A {@code Key} is used to do capture result field lookups with
57 * {@link CaptureResult#get}.
58 *
59 * <p>For example, to get the timestamp corresponding to the exposure of the first row:
60 * <code><pre>
61 * long timestamp = captureResult.get(CaptureResult.SENSOR_TIMESTAMP);
62 * </pre></code>
63 * </p>
64 *
65 * <p>To enumerate over all possible keys for {@link CaptureResult}, see
66 * {@link CameraCharacteristics#getAvailableCaptureResultKeys}.</p>
67 *
68 * @see CaptureResult#get
69 * @see CameraCharacteristics#getAvailableCaptureResultKeys
70 */
71 public final static class Key<T> {
72 private final CameraMetadataNative.Key<T> mKey;
73
74 /**
75 * Visible for testing and vendor extensions only.
76 *
77 * @hide
78 */
79 public Key(String name, Class<T> type) {
80 mKey = new CameraMetadataNative.Key<T>(name, type);
81 }
82
83 /**
84 * Visible for testing and vendor extensions only.
85 *
86 * @hide
87 */
88 public Key(String name, TypeReference<T> typeReference) {
89 mKey = new CameraMetadataNative.Key<T>(name, typeReference);
90 }
91
92 /**
93 * Return a camelCase, period separated name formatted like:
94 * {@code "root.section[.subsections].name"}.
95 *
96 * <p>Built-in keys exposed by the Android SDK are always prefixed with {@code "android."};
97 * keys that are device/platform-specific are prefixed with {@code "com."}.</p>
98 *
99 * <p>For example, {@code CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP} would
100 * have a name of {@code "android.scaler.streamConfigurationMap"}; whereas a device
101 * specific key might look like {@code "com.google.nexus.data.private"}.</p>
102 *
103 * @return String representation of the key name
104 */
105 public String getName() {
106 return mKey.getName();
107 }
108
109 /**
110 * {@inheritDoc}
111 */
112 @Override
113 public final int hashCode() {
114 return mKey.hashCode();
115 }
116
117 /**
118 * {@inheritDoc}
119 */
120 @SuppressWarnings("unchecked")
121 @Override
122 public final boolean equals(Object o) {
123 return o instanceof Key && ((Key<T>)o).mKey.equals(mKey);
124 }
125
126 /**
127 * Visible for CameraMetadataNative implementation only; do not use.
128 *
129 * TODO: Make this private or remove it altogether.
130 *
131 * @hide
132 */
133 public CameraMetadataNative.Key<T> getNativeKey() {
134 return mKey;
135 }
136
137 @SuppressWarnings({ "unchecked" })
138 /*package*/ Key(CameraMetadataNative.Key<?> nativeKey) {
139 mKey = (CameraMetadataNative.Key<T>) nativeKey;
140 }
141 }
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700142
143 private final CameraMetadataNative mResults;
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700144 private final CaptureRequest mRequest;
145 private final int mSequenceId;
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700146 private final long mFrameNumber;
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700147
Igor Murashkin70725502013-06-25 20:27:06 +0000148 /**
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700149 * Takes ownership of the passed-in properties object
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700150 *
151 * <p>For internal use only</p>
Igor Murashkin70725502013-06-25 20:27:06 +0000152 * @hide
153 */
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700154 public CaptureResult(CameraMetadataNative results, CaptureRequest parent,
155 CaptureResultExtras extras) {
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700156 if (results == null) {
157 throw new IllegalArgumentException("results was null");
158 }
159
160 if (parent == null) {
161 throw new IllegalArgumentException("parent was null");
162 }
163
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700164 if (extras == null) {
165 throw new IllegalArgumentException("extras was null");
166 }
167
Igor Murashkind6d65152014-05-19 16:31:02 -0700168 mResults = CameraMetadataNative.move(results);
169 if (mResults.isEmpty()) {
170 throw new AssertionError("Results must not be empty");
171 }
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700172 mRequest = parent;
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700173 mSequenceId = extras.getRequestId();
174 mFrameNumber = extras.getFrameNumber();
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700175 }
176
Ruben Brunkf967a542014-04-28 16:31:11 -0700177 /**
178 * Returns a copy of the underlying {@link CameraMetadataNative}.
179 * @hide
180 */
181 public CameraMetadataNative getNativeCopy() {
182 return new CameraMetadataNative(mResults);
183 }
184
Igor Murashkind6d65152014-05-19 16:31:02 -0700185 /**
186 * Creates a request-less result.
187 *
188 * <p><strong>For testing only.</strong></p>
189 * @hide
190 */
191 public CaptureResult(CameraMetadataNative results, int sequenceId) {
192 if (results == null) {
193 throw new IllegalArgumentException("results was null");
194 }
195
196 mResults = CameraMetadataNative.move(results);
197 if (mResults.isEmpty()) {
198 throw new AssertionError("Results must not be empty");
199 }
200
201 mRequest = null;
202 mSequenceId = sequenceId;
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700203 mFrameNumber = -1;
Igor Murashkind6d65152014-05-19 16:31:02 -0700204 }
205
206 /**
207 * Get a capture result field value.
208 *
209 * <p>The field definitions can be found in {@link CaptureResult}.</p>
210 *
211 * <p>Querying the value for the same key more than once will return a value
212 * which is equal to the previous queried value.</p>
213 *
214 * @throws IllegalArgumentException if the key was not valid
215 *
216 * @param key The result field to read.
217 * @return The value of that key, or {@code null} if the field is not set.
218 */
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700219 public <T> T get(Key<T> key) {
Igor Murashkind6d65152014-05-19 16:31:02 -0700220 T value = mResults.get(key);
221 if (VERBOSE) Log.v(TAG, "#get for Key = " + key.getName() + ", returned value = " + value);
222 return value;
223 }
224
225 /**
226 * {@inheritDoc}
227 * @hide
228 */
229 @SuppressWarnings("unchecked")
230 @Override
231 protected <T> T getProtected(Key<?> key) {
232 return (T) mResults.get(key);
233 }
234
235 /**
236 * {@inheritDoc}
237 * @hide
238 */
239 @SuppressWarnings("unchecked")
240 @Override
241 protected Class<Key<?>> getKeyClass() {
242 Object thisClass = Key.class;
243 return (Class<Key<?>>)thisClass;
244 }
245
246 /**
247 * Dumps the native metadata contents to logcat.
248 *
249 * <p>Visibility for testing/debugging only. The results will not
250 * include any synthesized keys, as they are invisible to the native layer.</p>
251 *
252 * @hide
253 */
254 public void dumpToLog() {
255 mResults.dumpToLog();
256 }
257
258 /**
259 * {@inheritDoc}
260 */
261 @Override
262 public List<Key<?>> getKeys() {
263 // Force the javadoc for this function to show up on the CaptureResult page
264 return super.getKeys();
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800265 }
266
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700267 /**
268 * Get the request associated with this result.
269 *
Igor Murashkindb075af2014-05-21 10:07:08 -0700270 * <p>Whenever a request has been fully or partially captured, with
Eino-Ville Talvalafd887432014-09-04 13:07:40 -0700271 * {@link CameraCaptureSession.CaptureCallback#onCaptureCompleted} or
272 * {@link CameraCaptureSession.CaptureCallback#onCaptureProgressed}, the {@code result}'s
Igor Murashkindb075af2014-05-21 10:07:08 -0700273 * {@code getRequest()} will return that {@code request}.
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700274 * </p>
275 *
Igor Murashkindb075af2014-05-21 10:07:08 -0700276 * <p>For example,
Eino-Ville Talvalafd887432014-09-04 13:07:40 -0700277 * <code><pre>cameraDevice.capture(someRequest, new CaptureCallback() {
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700278 * {@literal @}Override
279 * void onCaptureCompleted(CaptureRequest myRequest, CaptureResult myResult) {
280 * assert(myResult.getRequest.equals(myRequest) == true);
281 * }
Igor Murashkindb075af2014-05-21 10:07:08 -0700282 * }, null);
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700283 * </code></pre>
284 * </p>
285 *
286 * @return The request associated with this result. Never {@code null}.
287 */
288 public CaptureRequest getRequest() {
289 return mRequest;
290 }
291
292 /**
293 * Get the frame number associated with this result.
294 *
295 * <p>Whenever a request has been processed, regardless of failure or success,
296 * it gets a unique frame number assigned to its future result/failure.</p>
297 *
298 * <p>This value monotonically increments, starting with 0,
299 * for every new result or failure; and the scope is the lifetime of the
300 * {@link CameraDevice}.</p>
301 *
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700302 * @return The frame number
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700303 */
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700304 public long getFrameNumber() {
305 return mFrameNumber;
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700306 }
307
308 /**
309 * The sequence ID for this failure that was returned by the
Eino-Ville Talvala0a160ac2014-07-02 14:29:26 -0700310 * {@link CameraCaptureSession#capture} family of functions.
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700311 *
312 * <p>The sequence ID is a unique monotonically increasing value starting from 0,
313 * incremented every time a new group of requests is submitted to the CameraDevice.</p>
314 *
315 * @return int The ID for the sequence of requests that this capture result is a part of
316 *
Eino-Ville Talvalafd887432014-09-04 13:07:40 -0700317 * @see CameraDevice.CaptureCallback#onCaptureSequenceCompleted
318 * @see CameraDevice.CaptureCallback#onCaptureSequenceAborted
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700319 */
320 public int getSequenceId() {
321 return mSequenceId;
322 }
323
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700324 /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
325 * The key entries below this point are generated from metadata
326 * definitions in /system/media/camera/docs. Do not modify by hand or
327 * modify the comment blocks at the start or end.
328 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/
329
330 /**
Zhijun He379af012014-05-06 11:54:54 -0700331 * <p>The mode control selects how the image data is converted from the
332 * sensor's native color into linear sRGB color.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700333 * <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 -0700334 * control is overridden by the AWB routine. When AWB is disabled, the
335 * application controls how the color mapping is performed.</p>
336 * <p>We define the expected processing pipeline below. For consistency
337 * across devices, this is always the case with TRANSFORM_MATRIX.</p>
338 * <p>When either FULL or HIGH_QUALITY is used, the camera device may
339 * do additional processing but {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
340 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} will still be provided by the
341 * camera device (in the results) and be roughly correct.</p>
342 * <p>Switching to TRANSFORM_MATRIX and using the data provided from
343 * FAST or HIGH_QUALITY will yield a picture with the same white point
344 * as what was produced by the camera device in the earlier frame.</p>
345 * <p>The expected processing pipeline is as follows:</p>
346 * <p><img alt="White balance processing pipeline" src="../../../../images/camera2/metadata/android.colorCorrection.mode/processing_pipeline.png" /></p>
347 * <p>The white balance is encoded by two values, a 4-channel white-balance
348 * gain vector (applied in the Bayer domain), and a 3x3 color transform
349 * matrix (applied after demosaic).</p>
350 * <p>The 4-channel white-balance gains are defined as:</p>
351 * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} = [ R G_even G_odd B ]
352 * </code></pre>
353 * <p>where <code>G_even</code> is the gain for green pixels on even rows of the
354 * output, and <code>G_odd</code> is the gain for green pixels on the odd rows.
355 * These may be identical for a given camera device implementation; if
356 * the camera device does not support a separate gain for even/odd green
357 * channels, it will use the <code>G_even</code> value, and write <code>G_odd</code> equal to
358 * <code>G_even</code> in the output result metadata.</p>
359 * <p>The matrices for color transforms are defined as a 9-entry vector:</p>
360 * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} = [ I0 I1 I2 I3 I4 I5 I6 I7 I8 ]
361 * </code></pre>
362 * <p>which define a transform from input sensor colors, <code>P_in = [ r g b ]</code>,
363 * to output linear sRGB, <code>P_out = [ r' g' b' ]</code>,</p>
364 * <p>with colors as follows:</p>
365 * <pre><code>r' = I0r + I1g + I2b
366 * g' = I3r + I4g + I5b
367 * b' = I6r + I7g + I8b
368 * </code></pre>
369 * <p>Both the input and output value ranges must match. Overflow/underflow
370 * values are clipped to fit within the range.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700371 * <p><b>Possible values:</b>
372 * <ul>
373 * <li>{@link #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX TRANSFORM_MATRIX}</li>
374 * <li>{@link #COLOR_CORRECTION_MODE_FAST FAST}</li>
375 * <li>{@link #COLOR_CORRECTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
376 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700377 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
378 * <p><b>Full capability</b> -
379 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
380 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He379af012014-05-06 11:54:54 -0700381 *
382 * @see CaptureRequest#COLOR_CORRECTION_GAINS
383 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
384 * @see CaptureRequest#CONTROL_AWB_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700385 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He379af012014-05-06 11:54:54 -0700386 * @see #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX
387 * @see #COLOR_CORRECTION_MODE_FAST
388 * @see #COLOR_CORRECTION_MODE_HIGH_QUALITY
389 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700390 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700391 public static final Key<Integer> COLOR_CORRECTION_MODE =
392 new Key<Integer>("android.colorCorrection.mode", int.class);
393
394 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800395 * <p>A color transform matrix to use to transform
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700396 * from sensor RGB color space to output linear sRGB color space.</p>
Zhijun He49a3ca92014-02-05 13:48:09 -0800397 * <p>This matrix is either set by the camera device when the request
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800398 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700399 * directly by the application in the request when the
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800400 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p>
Zhijun He49a3ca92014-02-05 13:48:09 -0800401 * <p>In the latter case, the camera device may round the matrix to account
402 * for precision issues; the final rounded matrix should be reported back
403 * in this matrix result metadata. The transform should keep the magnitude
404 * of the output color values within <code>[0, 1.0]</code> (assuming input color
405 * values is within the normalized range <code>[0, 1.0]</code>), or clipping may occur.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700406 * <p><b>Units</b>: Unitless scale factors</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700407 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
408 * <p><b>Full capability</b> -
409 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
410 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800411 *
412 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700413 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700414 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700415 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700416 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> COLOR_CORRECTION_TRANSFORM =
417 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.colorCorrection.transform", android.hardware.camera2.params.ColorSpaceTransform.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700418
419 /**
Igor Murashkin7d2a5c52014-01-17 15:07:52 -0800420 * <p>Gains applying to Bayer raw color channels for
Zhijun Hecc28a412014-02-24 15:11:23 -0800421 * white-balance.</p>
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700422 * <p>These per-channel gains are either set by the camera device
423 * when the request {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not
424 * TRANSFORM_MATRIX, or directly by the application in the
425 * request when the {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is
426 * TRANSFORM_MATRIX.</p>
427 * <p>The gains in the result metadata are the gains actually
428 * applied by the camera device to the current frame.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700429 * <p><b>Units</b>: Unitless gain factors</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700430 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
431 * <p><b>Full capability</b> -
432 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
433 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800434 *
435 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700436 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700437 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700438 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700439 public static final Key<android.hardware.camera2.params.RggbChannelVector> COLOR_CORRECTION_GAINS =
440 new Key<android.hardware.camera2.params.RggbChannelVector>("android.colorCorrection.gains", android.hardware.camera2.params.RggbChannelVector.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700441
442 /**
Zhijun Hea05e59d2014-07-08 18:27:47 -0700443 * <p>Mode of operation for the chromatic aberration correction algorithm.</p>
Zhijun Hea05e59d2014-07-08 18:27:47 -0700444 * <p>Chromatic (color) aberration is caused by the fact that different wavelengths of light
445 * can not focus on the same point after exiting from the lens. This metadata defines
446 * the high level control of chromatic aberration correction algorithm, which aims to
447 * minimize the chromatic artifacts that may occur along the object boundaries in an
448 * image.</p>
449 * <p>FAST/HIGH_QUALITY both mean that camera device determined aberration
450 * correction will be applied. HIGH_QUALITY mode indicates that the camera device will
451 * use the highest-quality aberration correction algorithms, even if it slows down
452 * capture rate. FAST means the camera device will not slow down capture rate when
453 * applying aberration correction.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700454 * <p>LEGACY devices will always be in FAST mode.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700455 * <p><b>Possible values:</b>
456 * <ul>
457 * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_OFF OFF}</li>
458 * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_FAST FAST}</li>
459 * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
460 * </ul></p>
461 * <p><b>Available values for this device:</b><br>
462 * {@link CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES android.colorCorrection.availableAberrationModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700463 * <p>This key is available on all devices.</p>
Zhijun Hea05e59d2014-07-08 18:27:47 -0700464 *
Zhijun He9e4e4392014-08-18 11:12:32 -0700465 * @see CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES
466 * @see #COLOR_CORRECTION_ABERRATION_MODE_OFF
467 * @see #COLOR_CORRECTION_ABERRATION_MODE_FAST
468 * @see #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY
Zhijun Hea05e59d2014-07-08 18:27:47 -0700469 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700470 @PublicKey
Zhijun He9e4e4392014-08-18 11:12:32 -0700471 public static final Key<Integer> COLOR_CORRECTION_ABERRATION_MODE =
472 new Key<Integer>("android.colorCorrection.aberrationMode", int.class);
Zhijun Hea05e59d2014-07-08 18:27:47 -0700473
474 /**
Zhijun He379af012014-05-06 11:54:54 -0700475 * <p>The desired setting for the camera device's auto-exposure
476 * algorithm's antibanding compensation.</p>
477 * <p>Some kinds of lighting fixtures, such as some fluorescent
478 * lights, flicker at the rate of the power supply frequency
479 * (60Hz or 50Hz, depending on country). While this is
480 * typically not noticeable to a person, it can be visible to
481 * a camera device. If a camera sets its exposure time to the
482 * wrong value, the flicker may become visible in the
483 * viewfinder as flicker or in a final captured image, as a
484 * set of variable-brightness bands across the image.</p>
485 * <p>Therefore, the auto-exposure routines of camera devices
486 * include antibanding routines that ensure that the chosen
487 * exposure value will not cause such banding. The choice of
488 * exposure time depends on the rate of flicker, which the
489 * camera device can detect automatically, or the expected
490 * rate can be selected by the application using this
491 * control.</p>
492 * <p>A given camera device may not support all of the possible
493 * options for the antibanding mode. The
494 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes} key contains
495 * the available modes for a given camera device.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700496 * <p>The default mode is AUTO, which is supported by all
Zhijun He379af012014-05-06 11:54:54 -0700497 * camera devices.</p>
498 * <p>If manual exposure control is enabled (by setting
499 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} to OFF),
500 * then this setting has no effect, and the application must
501 * ensure it selects exposure times that do not cause banding
502 * issues. The {@link CaptureResult#STATISTICS_SCENE_FLICKER android.statistics.sceneFlicker} key can assist
503 * the application in this.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700504 * <p><b>Possible values:</b>
505 * <ul>
506 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_OFF OFF}</li>
507 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_50HZ 50HZ}</li>
508 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_60HZ 60HZ}</li>
509 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_AUTO AUTO}</li>
510 * </ul></p>
511 * <p><b>Available values for this device:</b><br></p>
512 * <p>{@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700513 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -0700514 *
515 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES
516 * @see CaptureRequest#CONTROL_AE_MODE
517 * @see CaptureRequest#CONTROL_MODE
518 * @see CaptureResult#STATISTICS_SCENE_FLICKER
519 * @see #CONTROL_AE_ANTIBANDING_MODE_OFF
520 * @see #CONTROL_AE_ANTIBANDING_MODE_50HZ
521 * @see #CONTROL_AE_ANTIBANDING_MODE_60HZ
522 * @see #CONTROL_AE_ANTIBANDING_MODE_AUTO
523 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700524 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700525 public static final Key<Integer> CONTROL_AE_ANTIBANDING_MODE =
526 new Key<Integer>("android.control.aeAntibandingMode", int.class);
527
528 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700529 * <p>Adjustment to auto-exposure (AE) target image
530 * brightness.</p>
531 * <p>The adjustment is measured as a count of steps, with the
532 * step size defined by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep} and the
533 * allowed range by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}.</p>
534 * <p>For example, if the exposure value (EV) step is 0.333, '6'
535 * will mean an exposure compensation of +2 EV; -3 will mean an
536 * exposure compensation of -1 EV. One EV represents a doubling
537 * of image brightness. Note that this control will only be
538 * effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF. This control
539 * 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 -0700540 * <p>In the event of exposure compensation value being changed, camera device
541 * may take several frames to reach the newly requested exposure target.
542 * During that time, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} field will be in the SEARCHING
543 * state. Once the new exposure target is reached, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} will
544 * change from SEARCHING to either CONVERGED, LOCKED (if AE lock is enabled), or
545 * FLASH_REQUIRED (if the scene is too dark for still capture).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700546 * <p><b>Units</b>: Compensation steps</p>
547 * <p><b>Range of valid values:</b><br>
548 * {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700549 * <p>This key is available on all devices.</p>
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700550 *
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700551 * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE
552 * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700553 * @see CaptureRequest#CONTROL_AE_LOCK
554 * @see CaptureRequest#CONTROL_AE_MODE
555 * @see CaptureResult#CONTROL_AE_STATE
Zhijun He379af012014-05-06 11:54:54 -0700556 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700557 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700558 public static final Key<Integer> CONTROL_AE_EXPOSURE_COMPENSATION =
559 new Key<Integer>("android.control.aeExposureCompensation", int.class);
560
561 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700562 * <p>Whether auto-exposure (AE) is currently locked to its latest
Zhijun He379af012014-05-06 11:54:54 -0700563 * calculated values.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700564 * <p>When set to <code>true</code> (ON), the AE algorithm is locked to its latest parameters,
565 * and will not change exposure settings until the lock is set to <code>false</code> (OFF).</p>
566 * <p>Note that even when AE is locked, the flash may be fired if
567 * the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_AUTO_FLASH /
568 * ON_ALWAYS_FLASH / ON_AUTO_FLASH_REDEYE.</p>
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700569 * <p>When {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation} is changed, even if the AE lock
570 * is ON, the camera device will still adjust its exposure value.</p>
Zhijun He379af012014-05-06 11:54:54 -0700571 * <p>If AE precapture is triggered (see {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger})
572 * when AE is already locked, the camera device will not change the exposure time
573 * ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}) and sensitivity ({@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity})
574 * parameters. The flash may be fired if the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}
575 * is ON_AUTO_FLASH/ON_AUTO_FLASH_REDEYE and the scene is too dark. If the
576 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_ALWAYS_FLASH, the scene may become overexposed.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700577 * <p>Since the camera device has a pipeline of in-flight requests, the settings that
578 * get locked do not necessarily correspond to the settings that were present in the
579 * latest capture result received from the camera device, since additional captures
580 * and AE updates may have occurred even before the result was sent out. If an
581 * application is switching between automatic and manual control and wishes to eliminate
582 * any flicker during the switch, the following procedure is recommended:</p>
583 * <ol>
584 * <li>Starting in auto-AE mode:</li>
585 * <li>Lock AE</li>
586 * <li>Wait for the first result to be output that has the AE locked</li>
587 * <li>Copy exposure settings from that result into a request, set the request to manual AE</li>
588 * <li>Submit the capture request, proceed to run manual AE as desired.</li>
589 * </ol>
Zhijun He379af012014-05-06 11:54:54 -0700590 * <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 -0700591 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -0700592 *
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700593 * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
Zhijun He379af012014-05-06 11:54:54 -0700594 * @see CaptureRequest#CONTROL_AE_MODE
595 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
596 * @see CaptureResult#CONTROL_AE_STATE
597 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
598 * @see CaptureRequest#SENSOR_SENSITIVITY
599 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700600 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700601 public static final Key<Boolean> CONTROL_AE_LOCK =
602 new Key<Boolean>("android.control.aeLock", boolean.class);
603
604 /**
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800605 * <p>The desired mode for the camera device's
606 * auto-exposure routine.</p>
607 * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is
608 * AUTO.</p>
609 * <p>When set to any of the ON modes, the camera device's
610 * auto-exposure routine is enabled, overriding the
611 * application's selected exposure time, sensor sensitivity,
612 * and frame duration ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
613 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and
614 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}). If one of the FLASH modes
615 * is selected, the camera device's flash unit controls are
616 * also overridden.</p>
617 * <p>The FLASH modes are only available if the camera device
618 * has a flash unit ({@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} is <code>true</code>).</p>
619 * <p>If flash TORCH mode is desired, this field must be set to
620 * ON or OFF, and {@link CaptureRequest#FLASH_MODE android.flash.mode} set to TORCH.</p>
621 * <p>When set to any of the ON modes, the values chosen by the
622 * camera device auto-exposure routine for the overridden
623 * fields for a given capture will be available in its
624 * CaptureResult.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700625 * <p><b>Possible values:</b>
626 * <ul>
627 * <li>{@link #CONTROL_AE_MODE_OFF OFF}</li>
628 * <li>{@link #CONTROL_AE_MODE_ON ON}</li>
629 * <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH ON_AUTO_FLASH}</li>
630 * <li>{@link #CONTROL_AE_MODE_ON_ALWAYS_FLASH ON_ALWAYS_FLASH}</li>
631 * <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE ON_AUTO_FLASH_REDEYE}</li>
632 * </ul></p>
633 * <p><b>Available values for this device:</b><br>
634 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES android.control.aeAvailableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700635 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800636 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700637 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES
Zhijun He5f2a47f2014-01-16 15:44:41 -0800638 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800639 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
640 * @see CaptureRequest#FLASH_MODE
Igor Murashkinaef3b7e2014-01-15 13:20:37 -0800641 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
642 * @see CaptureRequest#SENSOR_FRAME_DURATION
Zhijun He399f05d2014-01-15 11:31:30 -0800643 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800644 * @see #CONTROL_AE_MODE_OFF
645 * @see #CONTROL_AE_MODE_ON
646 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH
647 * @see #CONTROL_AE_MODE_ON_ALWAYS_FLASH
648 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE
649 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700650 @PublicKey
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800651 public static final Key<Integer> CONTROL_AE_MODE =
652 new Key<Integer>("android.control.aeMode", int.class);
653
654 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700655 * <p>List of metering areas to use for auto-exposure adjustment.</p>
656 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe} is 0.
Yin-Chia Yeh808150f2014-09-08 15:48:47 -0700657 * Otherwise will always be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700658 * <p>The maximum number of regions supported by the device is determined by the value
659 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe}.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -0800660 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -0700661 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800662 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
663 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -0700664 * bottom-right pixel in the active pixel array.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700665 * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -0700666 * for every pixel in the area. This means that a large metering area
667 * with the same weight as a smaller area will have more effect in
668 * the metering result. Metering areas can partially overlap and the
669 * camera device will add the weights in the overlap region.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700670 * <p>The weights are relative to weights of other exposure metering regions, so if only one
671 * region is used, all non-zero weights will have the same effect. A region with 0
672 * weight is ignored.</p>
673 * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
674 * camera device.</p>
675 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
676 * capture result metadata, the camera device will ignore the sections outside the crop
677 * region and output only the intersection rectangle as the metering region in the result
678 * metadata. If the region is entirely outside the crop region, it will be ignored and
679 * not reported in the result metadata.</p>
680 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
681 * <p><b>Range of valid values:</b><br>
682 * Coordinates must be between <code>[(0,0), (width, height))</code> of
683 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -0700684 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800685 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -0700686 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AE
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800687 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800688 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700689 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700690 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -0700691 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AE_REGIONS =
692 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.aeRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700693
694 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700695 * <p>Range over which the auto-exposure routine can
696 * adjust the capture frame rate to maintain good
697 * exposure.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700698 * <p>Only constrains auto-exposure (AE) algorithm, not
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700699 * manual control of {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime} and
700 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}.</p>
701 * <p><b>Units</b>: Frames per second (FPS)</p>
702 * <p><b>Range of valid values:</b><br>
703 * Any of the entries in {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES android.control.aeAvailableTargetFpsRanges}</p>
704 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -0700705 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700706 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES
Zhijun He379af012014-05-06 11:54:54 -0700707 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700708 * @see CaptureRequest#SENSOR_FRAME_DURATION
Zhijun He379af012014-05-06 11:54:54 -0700709 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700710 @PublicKey
Igor Murashkin78712a82014-05-27 18:32:18 -0700711 public static final Key<android.util.Range<Integer>> CONTROL_AE_TARGET_FPS_RANGE =
712 new Key<android.util.Range<Integer>>("android.control.aeTargetFpsRange", new TypeReference<android.util.Range<Integer>>() {{ }});
Zhijun He379af012014-05-06 11:54:54 -0700713
714 /**
715 * <p>Whether the camera device will trigger a precapture
716 * metering sequence when it processes this request.</p>
717 * <p>This entry is normally set to IDLE, or is not
718 * included at all in the request settings. When included and
719 * set to START, the camera device will trigger the autoexposure
720 * precapture metering sequence.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700721 * <p>The precapture sequence should triggered before starting a
722 * high-quality still capture for final metering decisions to
723 * be made, and for firing pre-capture flash pulses to estimate
724 * scene brightness and required final capture flash power, when
725 * the flash is enabled.</p>
726 * <p>Normally, this entry should be set to START for only a
727 * single request, and the application should wait until the
728 * sequence completes before starting a new one.</p>
729 * <p>The exact effect of auto-exposure (AE) precapture trigger
730 * depends on the current AE mode and state; see
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700731 * {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE precapture state transition
732 * details.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700733 * <p>On LEGACY-level devices, the precapture trigger is not supported;
734 * capturing a high-resolution JPEG image will automatically trigger a
735 * precapture sequence before the high-resolution capture, including
736 * potentially firing a pre-capture flash.</p>
737 * <p><b>Possible values:</b>
738 * <ul>
739 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE IDLE}</li>
740 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_START START}</li>
741 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700742 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
743 * <p><b>Limited capability</b> -
744 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
745 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He379af012014-05-06 11:54:54 -0700746 *
747 * @see CaptureResult#CONTROL_AE_STATE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700748 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He379af012014-05-06 11:54:54 -0700749 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE
750 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_START
751 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700752 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700753 public static final Key<Integer> CONTROL_AE_PRECAPTURE_TRIGGER =
754 new Key<Integer>("android.control.aePrecaptureTrigger", int.class);
755
756 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700757 * <p>Current state of the auto-exposure (AE) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -0800758 * <p>Switching between or enabling AE modes ({@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}) always
759 * resets the AE state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
760 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
761 * the algorithm states to INACTIVE.</p>
762 * <p>The camera device can do several state transitions between two results, if it is
763 * allowed by the state transition table. For example: INACTIVE may never actually be
764 * seen in a result.</p>
765 * <p>The state in the result is the state for this image (in sync with this image): if
766 * AE state becomes CONVERGED, then the image data associated with this result should
767 * be good to use.</p>
768 * <p>Below are state transition tables for different AE modes.</p>
769 * <table>
770 * <thead>
771 * <tr>
772 * <th align="center">State</th>
773 * <th align="center">Transition Cause</th>
774 * <th align="center">New State</th>
775 * <th align="center">Notes</th>
776 * </tr>
777 * </thead>
778 * <tbody>
779 * <tr>
780 * <td align="center">INACTIVE</td>
781 * <td align="center"></td>
782 * <td align="center">INACTIVE</td>
783 * <td align="center">Camera device auto exposure algorithm is disabled</td>
784 * </tr>
785 * </tbody>
786 * </table>
787 * <p>When {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is AE_MODE_ON_*:</p>
788 * <table>
789 * <thead>
790 * <tr>
791 * <th align="center">State</th>
792 * <th align="center">Transition Cause</th>
793 * <th align="center">New State</th>
794 * <th align="center">Notes</th>
795 * </tr>
796 * </thead>
797 * <tbody>
798 * <tr>
799 * <td align="center">INACTIVE</td>
800 * <td align="center">Camera device initiates AE scan</td>
801 * <td align="center">SEARCHING</td>
802 * <td align="center">Values changing</td>
803 * </tr>
804 * <tr>
805 * <td align="center">INACTIVE</td>
806 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
807 * <td align="center">LOCKED</td>
808 * <td align="center">Values locked</td>
809 * </tr>
810 * <tr>
811 * <td align="center">SEARCHING</td>
812 * <td align="center">Camera device finishes AE scan</td>
813 * <td align="center">CONVERGED</td>
814 * <td align="center">Good values, not changing</td>
815 * </tr>
816 * <tr>
817 * <td align="center">SEARCHING</td>
818 * <td align="center">Camera device finishes AE scan</td>
819 * <td align="center">FLASH_REQUIRED</td>
820 * <td align="center">Converged but too dark w/o flash</td>
821 * </tr>
822 * <tr>
823 * <td align="center">SEARCHING</td>
824 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
825 * <td align="center">LOCKED</td>
826 * <td align="center">Values locked</td>
827 * </tr>
828 * <tr>
829 * <td align="center">CONVERGED</td>
830 * <td align="center">Camera device initiates AE scan</td>
831 * <td align="center">SEARCHING</td>
832 * <td align="center">Values changing</td>
833 * </tr>
834 * <tr>
835 * <td align="center">CONVERGED</td>
836 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
837 * <td align="center">LOCKED</td>
838 * <td align="center">Values locked</td>
839 * </tr>
840 * <tr>
841 * <td align="center">FLASH_REQUIRED</td>
842 * <td align="center">Camera device initiates AE scan</td>
843 * <td align="center">SEARCHING</td>
844 * <td align="center">Values changing</td>
845 * </tr>
846 * <tr>
847 * <td align="center">FLASH_REQUIRED</td>
848 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
849 * <td align="center">LOCKED</td>
850 * <td align="center">Values locked</td>
851 * </tr>
852 * <tr>
853 * <td align="center">LOCKED</td>
854 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
855 * <td align="center">SEARCHING</td>
856 * <td align="center">Values not good after unlock</td>
857 * </tr>
858 * <tr>
859 * <td align="center">LOCKED</td>
860 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
861 * <td align="center">CONVERGED</td>
862 * <td align="center">Values good after unlock</td>
863 * </tr>
864 * <tr>
865 * <td align="center">LOCKED</td>
866 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
867 * <td align="center">FLASH_REQUIRED</td>
868 * <td align="center">Exposure good, but too dark</td>
869 * </tr>
870 * <tr>
871 * <td align="center">PRECAPTURE</td>
872 * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
873 * <td align="center">CONVERGED</td>
874 * <td align="center">Ready for high-quality capture</td>
875 * </tr>
876 * <tr>
877 * <td align="center">PRECAPTURE</td>
878 * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
879 * <td align="center">LOCKED</td>
880 * <td align="center">Ready for high-quality capture</td>
881 * </tr>
882 * <tr>
883 * <td align="center">Any state</td>
884 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START</td>
885 * <td align="center">PRECAPTURE</td>
886 * <td align="center">Start AE precapture metering sequence</td>
887 * </tr>
888 * </tbody>
889 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -0800890 * <p>For the above table, the camera device may skip reporting any state changes that happen
891 * without application intervention (i.e. mode switch, trigger, locking). Any state that
892 * can be skipped in that manner is called a transient state.</p>
893 * <p>For example, for above AE modes (AE_MODE_ON_*), in addition to the state transitions
894 * listed in above table, it is also legal for the camera device to skip one or more
895 * transient states between two results. See below table for examples:</p>
896 * <table>
897 * <thead>
898 * <tr>
899 * <th align="center">State</th>
900 * <th align="center">Transition Cause</th>
901 * <th align="center">New State</th>
902 * <th align="center">Notes</th>
903 * </tr>
904 * </thead>
905 * <tbody>
906 * <tr>
907 * <td align="center">INACTIVE</td>
908 * <td align="center">Camera device finished AE scan</td>
909 * <td align="center">CONVERGED</td>
910 * <td align="center">Values are already good, transient states are skipped by camera device.</td>
911 * </tr>
912 * <tr>
913 * <td align="center">Any state</td>
914 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td>
915 * <td align="center">FLASH_REQUIRED</td>
916 * <td align="center">Converged but too dark w/o flash after a precapture sequence, transient states are skipped by camera device.</td>
917 * </tr>
918 * <tr>
919 * <td align="center">Any state</td>
920 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td>
921 * <td align="center">CONVERGED</td>
922 * <td align="center">Converged after a precapture sequence, transient states are skipped by camera device.</td>
923 * </tr>
924 * <tr>
925 * <td align="center">CONVERGED</td>
926 * <td align="center">Camera device finished AE scan</td>
927 * <td align="center">FLASH_REQUIRED</td>
928 * <td align="center">Converged but too dark w/o flash after a new scan, transient states are skipped by camera device.</td>
929 * </tr>
930 * <tr>
931 * <td align="center">FLASH_REQUIRED</td>
932 * <td align="center">Camera device finished AE scan</td>
933 * <td align="center">CONVERGED</td>
934 * <td align="center">Converged after a new scan, transient states are skipped by camera device.</td>
935 * </tr>
936 * </tbody>
937 * </table>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700938 * <p><b>Possible values:</b>
939 * <ul>
940 * <li>{@link #CONTROL_AE_STATE_INACTIVE INACTIVE}</li>
941 * <li>{@link #CONTROL_AE_STATE_SEARCHING SEARCHING}</li>
942 * <li>{@link #CONTROL_AE_STATE_CONVERGED CONVERGED}</li>
943 * <li>{@link #CONTROL_AE_STATE_LOCKED LOCKED}</li>
944 * <li>{@link #CONTROL_AE_STATE_FLASH_REQUIRED FLASH_REQUIRED}</li>
945 * <li>{@link #CONTROL_AE_STATE_PRECAPTURE PRECAPTURE}</li>
946 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700947 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
948 * <p><b>Limited capability</b> -
949 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
950 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He228f4f92014-01-16 17:22:05 -0800951 *
952 * @see CaptureRequest#CONTROL_AE_LOCK
953 * @see CaptureRequest#CONTROL_AE_MODE
954 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
955 * @see CaptureRequest#CONTROL_MODE
956 * @see CaptureRequest#CONTROL_SCENE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700957 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700958 * @see #CONTROL_AE_STATE_INACTIVE
959 * @see #CONTROL_AE_STATE_SEARCHING
960 * @see #CONTROL_AE_STATE_CONVERGED
961 * @see #CONTROL_AE_STATE_LOCKED
962 * @see #CONTROL_AE_STATE_FLASH_REQUIRED
963 * @see #CONTROL_AE_STATE_PRECAPTURE
964 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700965 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700966 public static final Key<Integer> CONTROL_AE_STATE =
967 new Key<Integer>("android.control.aeState", int.class);
968
969 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700970 * <p>Whether auto-focus (AF) is currently enabled, and what
971 * mode it is set to.</p>
Zhijun Hecc28a412014-02-24 15:11:23 -0800972 * <p>Only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} = AUTO and the lens is not fixed focus
973 * (i.e. <code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} &gt; 0</code>).</p>
Zhijun He78146ec2014-01-14 18:12:13 -0800974 * <p>If the lens is controlled by the camera device auto-focus algorithm,
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -0800975 * 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 -0700976 * in result metadata.</p>
977 * <p><b>Possible values:</b>
978 * <ul>
979 * <li>{@link #CONTROL_AF_MODE_OFF OFF}</li>
980 * <li>{@link #CONTROL_AF_MODE_AUTO AUTO}</li>
981 * <li>{@link #CONTROL_AF_MODE_MACRO MACRO}</li>
982 * <li>{@link #CONTROL_AF_MODE_CONTINUOUS_VIDEO CONTINUOUS_VIDEO}</li>
983 * <li>{@link #CONTROL_AF_MODE_CONTINUOUS_PICTURE CONTINUOUS_PICTURE}</li>
984 * <li>{@link #CONTROL_AF_MODE_EDOF EDOF}</li>
985 * </ul></p>
986 * <p><b>Available values for this device:</b><br>
987 * {@link CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES android.control.afAvailableModes}</p>
988 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800989 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700990 * @see CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -0800991 * @see CaptureResult#CONTROL_AF_STATE
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800992 * @see CaptureRequest#CONTROL_MODE
Zhijun Hecc28a412014-02-24 15:11:23 -0800993 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700994 * @see #CONTROL_AF_MODE_OFF
995 * @see #CONTROL_AF_MODE_AUTO
996 * @see #CONTROL_AF_MODE_MACRO
997 * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO
998 * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE
999 * @see #CONTROL_AF_MODE_EDOF
1000 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001001 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001002 public static final Key<Integer> CONTROL_AF_MODE =
1003 new Key<Integer>("android.control.afMode", int.class);
1004
1005 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001006 * <p>List of metering areas to use for auto-focus.</p>
1007 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf} is 0.
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001008 * Otherwise will always be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001009 * <p>The maximum number of focus areas supported by the device is determined by the value
1010 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf}.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001011 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -07001012 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001013 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
1014 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001015 * bottom-right pixel in the active pixel array.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001016 * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001017 * for every pixel in the area. This means that a large metering area
1018 * with the same weight as a smaller area will have more effect in
1019 * the metering result. Metering areas can partially overlap and the
1020 * camera device will add the weights in the overlap region.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001021 * <p>The weights are relative to weights of other metering regions, so if only one region
1022 * is used, all non-zero weights will have the same effect. A region with 0 weight is
1023 * ignored.</p>
1024 * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
1025 * camera device.</p>
1026 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
1027 * capture result metadata, the camera device will ignore the sections outside the crop
1028 * region and output only the intersection rectangle as the metering region in the result
1029 * metadata. If the region is entirely outside the crop region, it will be ignored and
1030 * not reported in the result metadata.</p>
1031 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
1032 * <p><b>Range of valid values:</b><br>
1033 * Coordinates must be between <code>[(0,0), (width, height))</code> of
1034 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001035 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001036 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001037 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AF
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001038 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001039 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001040 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001041 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001042 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AF_REGIONS =
1043 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.afRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001044
1045 /**
Zhijun He379af012014-05-06 11:54:54 -07001046 * <p>Whether the camera device will trigger autofocus for this request.</p>
1047 * <p>This entry is normally set to IDLE, or is not
1048 * included at all in the request settings.</p>
1049 * <p>When included and set to START, the camera device will trigger the
1050 * autofocus algorithm. If autofocus is disabled, this trigger has no effect.</p>
1051 * <p>When set to CANCEL, the camera device will cancel any active trigger,
1052 * and return to its initial AF state.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001053 * <p>Generally, applications should set this entry to START or CANCEL for only a
1054 * single capture, and then return it to IDLE (or not set at all). Specifying
1055 * START for multiple captures in a row means restarting the AF operation over
1056 * and over again.</p>
1057 * <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 -07001058 * <p><b>Possible values:</b>
1059 * <ul>
1060 * <li>{@link #CONTROL_AF_TRIGGER_IDLE IDLE}</li>
1061 * <li>{@link #CONTROL_AF_TRIGGER_START START}</li>
1062 * <li>{@link #CONTROL_AF_TRIGGER_CANCEL CANCEL}</li>
1063 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001064 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001065 *
1066 * @see CaptureResult#CONTROL_AF_STATE
1067 * @see #CONTROL_AF_TRIGGER_IDLE
1068 * @see #CONTROL_AF_TRIGGER_START
1069 * @see #CONTROL_AF_TRIGGER_CANCEL
1070 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001071 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001072 public static final Key<Integer> CONTROL_AF_TRIGGER =
1073 new Key<Integer>("android.control.afTrigger", int.class);
1074
1075 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001076 * <p>Current state of auto-focus (AF) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001077 * <p>Switching between or enabling AF modes ({@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}) always
1078 * resets the AF state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
1079 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
1080 * the algorithm states to INACTIVE.</p>
1081 * <p>The camera device can do several state transitions between two results, if it is
1082 * allowed by the state transition table. For example: INACTIVE may never actually be
1083 * seen in a result.</p>
1084 * <p>The state in the result is the state for this image (in sync with this image): if
1085 * AF state becomes FOCUSED, then the image data associated with this result should
1086 * be sharp.</p>
1087 * <p>Below are state transition tables for different AF modes.</p>
1088 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_OFF or AF_MODE_EDOF:</p>
1089 * <table>
1090 * <thead>
1091 * <tr>
1092 * <th align="center">State</th>
1093 * <th align="center">Transition Cause</th>
1094 * <th align="center">New State</th>
1095 * <th align="center">Notes</th>
1096 * </tr>
1097 * </thead>
1098 * <tbody>
1099 * <tr>
1100 * <td align="center">INACTIVE</td>
1101 * <td align="center"></td>
1102 * <td align="center">INACTIVE</td>
1103 * <td align="center">Never changes</td>
1104 * </tr>
1105 * </tbody>
1106 * </table>
1107 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_AUTO or AF_MODE_MACRO:</p>
1108 * <table>
1109 * <thead>
1110 * <tr>
1111 * <th align="center">State</th>
1112 * <th align="center">Transition Cause</th>
1113 * <th align="center">New State</th>
1114 * <th align="center">Notes</th>
1115 * </tr>
1116 * </thead>
1117 * <tbody>
1118 * <tr>
1119 * <td align="center">INACTIVE</td>
1120 * <td align="center">AF_TRIGGER</td>
1121 * <td align="center">ACTIVE_SCAN</td>
1122 * <td align="center">Start AF sweep, Lens now moving</td>
1123 * </tr>
1124 * <tr>
1125 * <td align="center">ACTIVE_SCAN</td>
1126 * <td align="center">AF sweep done</td>
1127 * <td align="center">FOCUSED_LOCKED</td>
1128 * <td align="center">Focused, Lens now locked</td>
1129 * </tr>
1130 * <tr>
1131 * <td align="center">ACTIVE_SCAN</td>
1132 * <td align="center">AF sweep done</td>
1133 * <td align="center">NOT_FOCUSED_LOCKED</td>
1134 * <td align="center">Not focused, Lens now locked</td>
1135 * </tr>
1136 * <tr>
1137 * <td align="center">ACTIVE_SCAN</td>
1138 * <td align="center">AF_CANCEL</td>
1139 * <td align="center">INACTIVE</td>
1140 * <td align="center">Cancel/reset AF, Lens now locked</td>
1141 * </tr>
1142 * <tr>
1143 * <td align="center">FOCUSED_LOCKED</td>
1144 * <td align="center">AF_CANCEL</td>
1145 * <td align="center">INACTIVE</td>
1146 * <td align="center">Cancel/reset AF</td>
1147 * </tr>
1148 * <tr>
1149 * <td align="center">FOCUSED_LOCKED</td>
1150 * <td align="center">AF_TRIGGER</td>
1151 * <td align="center">ACTIVE_SCAN</td>
1152 * <td align="center">Start new sweep, Lens now moving</td>
1153 * </tr>
1154 * <tr>
1155 * <td align="center">NOT_FOCUSED_LOCKED</td>
1156 * <td align="center">AF_CANCEL</td>
1157 * <td align="center">INACTIVE</td>
1158 * <td align="center">Cancel/reset AF</td>
1159 * </tr>
1160 * <tr>
1161 * <td align="center">NOT_FOCUSED_LOCKED</td>
1162 * <td align="center">AF_TRIGGER</td>
1163 * <td align="center">ACTIVE_SCAN</td>
1164 * <td align="center">Start new sweep, Lens now moving</td>
1165 * </tr>
1166 * <tr>
1167 * <td align="center">Any state</td>
1168 * <td align="center">Mode change</td>
1169 * <td align="center">INACTIVE</td>
1170 * <td align="center"></td>
1171 * </tr>
1172 * </tbody>
1173 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -08001174 * <p>For the above table, the camera device may skip reporting any state changes that happen
1175 * without application intervention (i.e. mode switch, trigger, locking). Any state that
1176 * can be skipped in that manner is called a transient state.</p>
1177 * <p>For example, for these AF modes (AF_MODE_AUTO and AF_MODE_MACRO), in addition to the
1178 * state transitions listed in above table, it is also legal for the camera device to skip
1179 * one or more transient states between two results. See below table for examples:</p>
1180 * <table>
1181 * <thead>
1182 * <tr>
1183 * <th align="center">State</th>
1184 * <th align="center">Transition Cause</th>
1185 * <th align="center">New State</th>
1186 * <th align="center">Notes</th>
1187 * </tr>
1188 * </thead>
1189 * <tbody>
1190 * <tr>
1191 * <td align="center">INACTIVE</td>
1192 * <td align="center">AF_TRIGGER</td>
1193 * <td align="center">FOCUSED_LOCKED</td>
1194 * <td align="center">Focus is already good or good after a scan, lens is now locked.</td>
1195 * </tr>
1196 * <tr>
1197 * <td align="center">INACTIVE</td>
1198 * <td align="center">AF_TRIGGER</td>
1199 * <td align="center">NOT_FOCUSED_LOCKED</td>
1200 * <td align="center">Focus failed after a scan, lens is now locked.</td>
1201 * </tr>
1202 * <tr>
1203 * <td align="center">FOCUSED_LOCKED</td>
1204 * <td align="center">AF_TRIGGER</td>
1205 * <td align="center">FOCUSED_LOCKED</td>
1206 * <td align="center">Focus is already good or good after a scan, lens is now locked.</td>
1207 * </tr>
1208 * <tr>
1209 * <td align="center">NOT_FOCUSED_LOCKED</td>
1210 * <td align="center">AF_TRIGGER</td>
1211 * <td align="center">FOCUSED_LOCKED</td>
1212 * <td align="center">Focus is good after a scan, lens is not locked.</td>
1213 * </tr>
1214 * </tbody>
1215 * </table>
Zhijun He228f4f92014-01-16 17:22:05 -08001216 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_VIDEO:</p>
1217 * <table>
1218 * <thead>
1219 * <tr>
1220 * <th align="center">State</th>
1221 * <th align="center">Transition Cause</th>
1222 * <th align="center">New State</th>
1223 * <th align="center">Notes</th>
1224 * </tr>
1225 * </thead>
1226 * <tbody>
1227 * <tr>
1228 * <td align="center">INACTIVE</td>
1229 * <td align="center">Camera device initiates new scan</td>
1230 * <td align="center">PASSIVE_SCAN</td>
1231 * <td align="center">Start AF scan, Lens now moving</td>
1232 * </tr>
1233 * <tr>
1234 * <td align="center">INACTIVE</td>
1235 * <td align="center">AF_TRIGGER</td>
1236 * <td align="center">NOT_FOCUSED_LOCKED</td>
1237 * <td align="center">AF state query, Lens now locked</td>
1238 * </tr>
1239 * <tr>
1240 * <td align="center">PASSIVE_SCAN</td>
1241 * <td align="center">Camera device completes current scan</td>
1242 * <td align="center">PASSIVE_FOCUSED</td>
1243 * <td align="center">End AF scan, Lens now locked</td>
1244 * </tr>
1245 * <tr>
1246 * <td align="center">PASSIVE_SCAN</td>
1247 * <td align="center">Camera device fails current scan</td>
1248 * <td align="center">PASSIVE_UNFOCUSED</td>
1249 * <td align="center">End AF scan, Lens now locked</td>
1250 * </tr>
1251 * <tr>
1252 * <td align="center">PASSIVE_SCAN</td>
1253 * <td align="center">AF_TRIGGER</td>
1254 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001255 * <td align="center">Immediate transition, if focus is good. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001256 * </tr>
1257 * <tr>
1258 * <td align="center">PASSIVE_SCAN</td>
1259 * <td align="center">AF_TRIGGER</td>
1260 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001261 * <td align="center">Immediate transition, if focus is bad. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001262 * </tr>
1263 * <tr>
1264 * <td align="center">PASSIVE_SCAN</td>
1265 * <td align="center">AF_CANCEL</td>
1266 * <td align="center">INACTIVE</td>
1267 * <td align="center">Reset lens position, Lens now locked</td>
1268 * </tr>
1269 * <tr>
1270 * <td align="center">PASSIVE_FOCUSED</td>
1271 * <td align="center">Camera device initiates new scan</td>
1272 * <td align="center">PASSIVE_SCAN</td>
1273 * <td align="center">Start AF scan, Lens now moving</td>
1274 * </tr>
1275 * <tr>
1276 * <td align="center">PASSIVE_UNFOCUSED</td>
1277 * <td align="center">Camera device initiates new scan</td>
1278 * <td align="center">PASSIVE_SCAN</td>
1279 * <td align="center">Start AF scan, Lens now moving</td>
1280 * </tr>
1281 * <tr>
1282 * <td align="center">PASSIVE_FOCUSED</td>
1283 * <td align="center">AF_TRIGGER</td>
1284 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001285 * <td align="center">Immediate transition, lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001286 * </tr>
1287 * <tr>
1288 * <td align="center">PASSIVE_UNFOCUSED</td>
1289 * <td align="center">AF_TRIGGER</td>
1290 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001291 * <td align="center">Immediate transition, lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001292 * </tr>
1293 * <tr>
1294 * <td align="center">FOCUSED_LOCKED</td>
1295 * <td align="center">AF_TRIGGER</td>
1296 * <td align="center">FOCUSED_LOCKED</td>
1297 * <td align="center">No effect</td>
1298 * </tr>
1299 * <tr>
1300 * <td align="center">FOCUSED_LOCKED</td>
1301 * <td align="center">AF_CANCEL</td>
1302 * <td align="center">INACTIVE</td>
1303 * <td align="center">Restart AF scan</td>
1304 * </tr>
1305 * <tr>
1306 * <td align="center">NOT_FOCUSED_LOCKED</td>
1307 * <td align="center">AF_TRIGGER</td>
1308 * <td align="center">NOT_FOCUSED_LOCKED</td>
1309 * <td align="center">No effect</td>
1310 * </tr>
1311 * <tr>
1312 * <td align="center">NOT_FOCUSED_LOCKED</td>
1313 * <td align="center">AF_CANCEL</td>
1314 * <td align="center">INACTIVE</td>
1315 * <td align="center">Restart AF scan</td>
1316 * </tr>
1317 * </tbody>
1318 * </table>
1319 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_PICTURE:</p>
1320 * <table>
1321 * <thead>
1322 * <tr>
1323 * <th align="center">State</th>
1324 * <th align="center">Transition Cause</th>
1325 * <th align="center">New State</th>
1326 * <th align="center">Notes</th>
1327 * </tr>
1328 * </thead>
1329 * <tbody>
1330 * <tr>
1331 * <td align="center">INACTIVE</td>
1332 * <td align="center">Camera device initiates new scan</td>
1333 * <td align="center">PASSIVE_SCAN</td>
1334 * <td align="center">Start AF scan, Lens now moving</td>
1335 * </tr>
1336 * <tr>
1337 * <td align="center">INACTIVE</td>
1338 * <td align="center">AF_TRIGGER</td>
1339 * <td align="center">NOT_FOCUSED_LOCKED</td>
1340 * <td align="center">AF state query, Lens now locked</td>
1341 * </tr>
1342 * <tr>
1343 * <td align="center">PASSIVE_SCAN</td>
1344 * <td align="center">Camera device completes current scan</td>
1345 * <td align="center">PASSIVE_FOCUSED</td>
1346 * <td align="center">End AF scan, Lens now locked</td>
1347 * </tr>
1348 * <tr>
1349 * <td align="center">PASSIVE_SCAN</td>
1350 * <td align="center">Camera device fails current scan</td>
1351 * <td align="center">PASSIVE_UNFOCUSED</td>
1352 * <td align="center">End AF scan, Lens now locked</td>
1353 * </tr>
1354 * <tr>
1355 * <td align="center">PASSIVE_SCAN</td>
1356 * <td align="center">AF_TRIGGER</td>
1357 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001358 * <td align="center">Eventual transition once the focus is good. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001359 * </tr>
1360 * <tr>
1361 * <td align="center">PASSIVE_SCAN</td>
1362 * <td align="center">AF_TRIGGER</td>
1363 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001364 * <td align="center">Eventual transition if cannot find focus. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001365 * </tr>
1366 * <tr>
1367 * <td align="center">PASSIVE_SCAN</td>
1368 * <td align="center">AF_CANCEL</td>
1369 * <td align="center">INACTIVE</td>
1370 * <td align="center">Reset lens position, Lens now locked</td>
1371 * </tr>
1372 * <tr>
1373 * <td align="center">PASSIVE_FOCUSED</td>
1374 * <td align="center">Camera device initiates new scan</td>
1375 * <td align="center">PASSIVE_SCAN</td>
1376 * <td align="center">Start AF scan, Lens now moving</td>
1377 * </tr>
1378 * <tr>
1379 * <td align="center">PASSIVE_UNFOCUSED</td>
1380 * <td align="center">Camera device initiates new scan</td>
1381 * <td align="center">PASSIVE_SCAN</td>
1382 * <td align="center">Start AF scan, Lens now moving</td>
1383 * </tr>
1384 * <tr>
1385 * <td align="center">PASSIVE_FOCUSED</td>
1386 * <td align="center">AF_TRIGGER</td>
1387 * <td align="center">FOCUSED_LOCKED</td>
1388 * <td align="center">Immediate trans. Lens now locked</td>
1389 * </tr>
1390 * <tr>
1391 * <td align="center">PASSIVE_UNFOCUSED</td>
1392 * <td align="center">AF_TRIGGER</td>
1393 * <td align="center">NOT_FOCUSED_LOCKED</td>
1394 * <td align="center">Immediate trans. Lens now locked</td>
1395 * </tr>
1396 * <tr>
1397 * <td align="center">FOCUSED_LOCKED</td>
1398 * <td align="center">AF_TRIGGER</td>
1399 * <td align="center">FOCUSED_LOCKED</td>
1400 * <td align="center">No effect</td>
1401 * </tr>
1402 * <tr>
1403 * <td align="center">FOCUSED_LOCKED</td>
1404 * <td align="center">AF_CANCEL</td>
1405 * <td align="center">INACTIVE</td>
1406 * <td align="center">Restart AF scan</td>
1407 * </tr>
1408 * <tr>
1409 * <td align="center">NOT_FOCUSED_LOCKED</td>
1410 * <td align="center">AF_TRIGGER</td>
1411 * <td align="center">NOT_FOCUSED_LOCKED</td>
1412 * <td align="center">No effect</td>
1413 * </tr>
1414 * <tr>
1415 * <td align="center">NOT_FOCUSED_LOCKED</td>
1416 * <td align="center">AF_CANCEL</td>
1417 * <td align="center">INACTIVE</td>
1418 * <td align="center">Restart AF scan</td>
1419 * </tr>
1420 * </tbody>
1421 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -08001422 * <p>When switch between AF_MODE_CONTINUOUS_* (CAF modes) and AF_MODE_AUTO/AF_MODE_MACRO
1423 * (AUTO modes), the initial INACTIVE or PASSIVE_SCAN states may be skipped by the
1424 * camera device. When a trigger is included in a mode switch request, the trigger
1425 * will be evaluated in the context of the new mode in the request.
1426 * See below table for examples:</p>
1427 * <table>
1428 * <thead>
1429 * <tr>
1430 * <th align="center">State</th>
1431 * <th align="center">Transition Cause</th>
1432 * <th align="center">New State</th>
1433 * <th align="center">Notes</th>
1434 * </tr>
1435 * </thead>
1436 * <tbody>
1437 * <tr>
1438 * <td align="center">any state</td>
1439 * <td align="center">CAF--&gt;AUTO mode switch</td>
1440 * <td align="center">INACTIVE</td>
1441 * <td align="center">Mode switch without trigger, initial state must be INACTIVE</td>
1442 * </tr>
1443 * <tr>
1444 * <td align="center">any state</td>
1445 * <td align="center">CAF--&gt;AUTO mode switch with AF_TRIGGER</td>
1446 * <td align="center">trigger-reachable states from INACTIVE</td>
1447 * <td align="center">Mode switch with trigger, INACTIVE is skipped</td>
1448 * </tr>
1449 * <tr>
1450 * <td align="center">any state</td>
1451 * <td align="center">AUTO--&gt;CAF mode switch</td>
1452 * <td align="center">passively reachable states from INACTIVE</td>
1453 * <td align="center">Mode switch without trigger, passive transient state is skipped</td>
1454 * </tr>
1455 * </tbody>
1456 * </table>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001457 * <p><b>Possible values:</b>
1458 * <ul>
1459 * <li>{@link #CONTROL_AF_STATE_INACTIVE INACTIVE}</li>
1460 * <li>{@link #CONTROL_AF_STATE_PASSIVE_SCAN PASSIVE_SCAN}</li>
1461 * <li>{@link #CONTROL_AF_STATE_PASSIVE_FOCUSED PASSIVE_FOCUSED}</li>
1462 * <li>{@link #CONTROL_AF_STATE_ACTIVE_SCAN ACTIVE_SCAN}</li>
1463 * <li>{@link #CONTROL_AF_STATE_FOCUSED_LOCKED FOCUSED_LOCKED}</li>
1464 * <li>{@link #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED NOT_FOCUSED_LOCKED}</li>
1465 * <li>{@link #CONTROL_AF_STATE_PASSIVE_UNFOCUSED PASSIVE_UNFOCUSED}</li>
1466 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001467 * <p>This key is available on all devices.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001468 *
1469 * @see CaptureRequest#CONTROL_AF_MODE
1470 * @see CaptureRequest#CONTROL_MODE
1471 * @see CaptureRequest#CONTROL_SCENE_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001472 * @see #CONTROL_AF_STATE_INACTIVE
1473 * @see #CONTROL_AF_STATE_PASSIVE_SCAN
1474 * @see #CONTROL_AF_STATE_PASSIVE_FOCUSED
1475 * @see #CONTROL_AF_STATE_ACTIVE_SCAN
1476 * @see #CONTROL_AF_STATE_FOCUSED_LOCKED
1477 * @see #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED
Eino-Ville Talvala9f880f72013-09-20 17:50:41 -07001478 * @see #CONTROL_AF_STATE_PASSIVE_UNFOCUSED
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001479 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001480 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001481 public static final Key<Integer> CONTROL_AF_STATE =
1482 new Key<Integer>("android.control.afState", int.class);
1483
1484 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001485 * <p>Whether auto-white balance (AWB) is currently locked to its
Zhijun He379af012014-05-06 11:54:54 -07001486 * latest calculated values.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001487 * <p>When set to <code>true</code> (ON), the AWB algorithm is locked to its latest parameters,
1488 * and will not change color balance settings until the lock is set to <code>false</code> (OFF).</p>
1489 * <p>Since the camera device has a pipeline of in-flight requests, the settings that
1490 * get locked do not necessarily correspond to the settings that were present in the
1491 * latest capture result received from the camera device, since additional captures
1492 * and AWB updates may have occurred even before the result was sent out. If an
1493 * application is switching between automatic and manual control and wishes to eliminate
1494 * any flicker during the switch, the following procedure is recommended:</p>
1495 * <ol>
1496 * <li>Starting in auto-AWB mode:</li>
1497 * <li>Lock AWB</li>
1498 * <li>Wait for the first result to be output that has the AWB locked</li>
1499 * <li>Copy AWB settings from that result into a request, set the request to manual AWB</li>
1500 * <li>Submit the capture request, proceed to run manual AWB as desired.</li>
1501 * </ol>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001502 * <p>Note that AWB lock is only meaningful when
1503 * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is in the AUTO mode; in other modes,
1504 * AWB is already fixed to a specific setting.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001505 * <p>Some LEGACY devices may not support ON; the value is then overridden to OFF.</p>
1506 * <p>This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001507 *
1508 * @see CaptureRequest#CONTROL_AWB_MODE
Zhijun He379af012014-05-06 11:54:54 -07001509 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001510 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001511 public static final Key<Boolean> CONTROL_AWB_LOCK =
1512 new Key<Boolean>("android.control.awbLock", boolean.class);
1513
1514 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001515 * <p>Whether auto-white balance (AWB) is currently setting the color
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001516 * transform fields, and what its illumination target
Zhijun Hecc28a412014-02-24 15:11:23 -08001517 * is.</p>
Zhijun He399f05d2014-01-15 11:31:30 -08001518 * <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 -07001519 * <p>When set to the ON mode, the camera device's auto-white balance
Zhijun He399f05d2014-01-15 11:31:30 -08001520 * routine is enabled, overriding the application's selected
1521 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
1522 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001523 * <p>When set to the OFF mode, the camera device's auto-white balance
Zhijun Hecc28a412014-02-24 15:11:23 -08001524 * routine is disabled. The application manually controls the white
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001525 * 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 -08001526 * and {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001527 * <p>When set to any other modes, the camera device's auto-white
1528 * balance routine is disabled. The camera device uses each
1529 * particular illumination target for white balance
1530 * adjustment. The application's values for
1531 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform},
1532 * {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
1533 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} are ignored.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001534 * <p><b>Possible values:</b>
1535 * <ul>
1536 * <li>{@link #CONTROL_AWB_MODE_OFF OFF}</li>
1537 * <li>{@link #CONTROL_AWB_MODE_AUTO AUTO}</li>
1538 * <li>{@link #CONTROL_AWB_MODE_INCANDESCENT INCANDESCENT}</li>
1539 * <li>{@link #CONTROL_AWB_MODE_FLUORESCENT FLUORESCENT}</li>
1540 * <li>{@link #CONTROL_AWB_MODE_WARM_FLUORESCENT WARM_FLUORESCENT}</li>
1541 * <li>{@link #CONTROL_AWB_MODE_DAYLIGHT DAYLIGHT}</li>
1542 * <li>{@link #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT CLOUDY_DAYLIGHT}</li>
1543 * <li>{@link #CONTROL_AWB_MODE_TWILIGHT TWILIGHT}</li>
1544 * <li>{@link #CONTROL_AWB_MODE_SHADE SHADE}</li>
1545 * </ul></p>
1546 * <p><b>Available values for this device:</b><br>
1547 * {@link CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES android.control.awbAvailableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001548 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001549 *
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001550 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Zhijun He5f2a47f2014-01-16 15:44:41 -08001551 * @see CaptureRequest#COLOR_CORRECTION_MODE
1552 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001553 * @see CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001554 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001555 * @see #CONTROL_AWB_MODE_OFF
1556 * @see #CONTROL_AWB_MODE_AUTO
1557 * @see #CONTROL_AWB_MODE_INCANDESCENT
1558 * @see #CONTROL_AWB_MODE_FLUORESCENT
1559 * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT
1560 * @see #CONTROL_AWB_MODE_DAYLIGHT
1561 * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT
1562 * @see #CONTROL_AWB_MODE_TWILIGHT
1563 * @see #CONTROL_AWB_MODE_SHADE
1564 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001565 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001566 public static final Key<Integer> CONTROL_AWB_MODE =
1567 new Key<Integer>("android.control.awbMode", int.class);
1568
1569 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001570 * <p>List of metering areas to use for auto-white-balance illuminant
Ruben Brunkf59521d2014-02-03 17:14:33 -08001571 * estimation.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001572 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb} is 0.
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001573 * Otherwise will always be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001574 * <p>The maximum number of regions supported by the device is determined by the value
1575 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb}.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001576 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -07001577 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001578 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
1579 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001580 * bottom-right pixel in the active pixel array.</p>
1581 * <p>The weight must range from 0 to 1000, and represents a weight
1582 * for every pixel in the area. This means that a large metering area
1583 * with the same weight as a smaller area will have more effect in
1584 * the metering result. Metering areas can partially overlap and the
1585 * camera device will add the weights in the overlap region.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001586 * <p>The weights are relative to weights of other white balance metering regions, so if
1587 * only one region is used, all non-zero weights will have the same effect. A region with
1588 * 0 weight is ignored.</p>
1589 * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
1590 * camera device.</p>
1591 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
1592 * capture result metadata, the camera device will ignore the sections outside the crop
1593 * region and output only the intersection rectangle as the metering region in the result
1594 * metadata. If the region is entirely outside the crop region, it will be ignored and
1595 * not reported in the result metadata.</p>
1596 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
1597 * <p><b>Range of valid values:</b><br>
1598 * Coordinates must be between <code>[(0,0), (width, height))</code> of
1599 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001600 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001601 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001602 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AWB
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001603 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001604 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001605 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001606 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001607 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS =
1608 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.awbRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001609
1610 /**
Zhijun He379af012014-05-06 11:54:54 -07001611 * <p>Information to the camera device 3A (auto-exposure,
1612 * auto-focus, auto-white balance) routines about the purpose
1613 * of this capture, to help the camera device to decide optimal 3A
1614 * strategy.</p>
1615 * <p>This control (except for MANUAL) is only effective if
1616 * <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 -07001617 * <p>ZERO_SHUTTER_LAG will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
1618 * contains ZSL. MANUAL will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001619 * contains MANUAL_SENSOR. Other intent values are always supported.</p>
1620 * <p><b>Possible values:</b>
1621 * <ul>
1622 * <li>{@link #CONTROL_CAPTURE_INTENT_CUSTOM CUSTOM}</li>
1623 * <li>{@link #CONTROL_CAPTURE_INTENT_PREVIEW PREVIEW}</li>
1624 * <li>{@link #CONTROL_CAPTURE_INTENT_STILL_CAPTURE STILL_CAPTURE}</li>
1625 * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_RECORD VIDEO_RECORD}</li>
1626 * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT VIDEO_SNAPSHOT}</li>
1627 * <li>{@link #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li>
1628 * <li>{@link #CONTROL_CAPTURE_INTENT_MANUAL MANUAL}</li>
1629 * </ul></p>
1630 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001631 *
1632 * @see CaptureRequest#CONTROL_MODE
1633 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1634 * @see #CONTROL_CAPTURE_INTENT_CUSTOM
1635 * @see #CONTROL_CAPTURE_INTENT_PREVIEW
1636 * @see #CONTROL_CAPTURE_INTENT_STILL_CAPTURE
1637 * @see #CONTROL_CAPTURE_INTENT_VIDEO_RECORD
1638 * @see #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT
1639 * @see #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG
1640 * @see #CONTROL_CAPTURE_INTENT_MANUAL
1641 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001642 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001643 public static final Key<Integer> CONTROL_CAPTURE_INTENT =
1644 new Key<Integer>("android.control.captureIntent", int.class);
1645
1646 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001647 * <p>Current state of auto-white balance (AWB) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001648 * <p>Switching between or enabling AWB modes ({@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}) always
1649 * resets the AWB state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
1650 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
1651 * the algorithm states to INACTIVE.</p>
1652 * <p>The camera device can do several state transitions between two results, if it is
1653 * allowed by the state transition table. So INACTIVE may never actually be seen in
1654 * a result.</p>
1655 * <p>The state in the result is the state for this image (in sync with this image): if
1656 * AWB state becomes CONVERGED, then the image data associated with this result should
1657 * be good to use.</p>
1658 * <p>Below are state transition tables for different AWB modes.</p>
1659 * <p>When <code>{@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} != AWB_MODE_AUTO</code>:</p>
1660 * <table>
1661 * <thead>
1662 * <tr>
1663 * <th align="center">State</th>
1664 * <th align="center">Transition Cause</th>
1665 * <th align="center">New State</th>
1666 * <th align="center">Notes</th>
1667 * </tr>
1668 * </thead>
1669 * <tbody>
1670 * <tr>
1671 * <td align="center">INACTIVE</td>
1672 * <td align="center"></td>
1673 * <td align="center">INACTIVE</td>
1674 * <td align="center">Camera device auto white balance algorithm is disabled</td>
1675 * </tr>
1676 * </tbody>
1677 * </table>
1678 * <p>When {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is AWB_MODE_AUTO:</p>
1679 * <table>
1680 * <thead>
1681 * <tr>
1682 * <th align="center">State</th>
1683 * <th align="center">Transition Cause</th>
1684 * <th align="center">New State</th>
1685 * <th align="center">Notes</th>
1686 * </tr>
1687 * </thead>
1688 * <tbody>
1689 * <tr>
1690 * <td align="center">INACTIVE</td>
1691 * <td align="center">Camera device initiates AWB scan</td>
1692 * <td align="center">SEARCHING</td>
1693 * <td align="center">Values changing</td>
1694 * </tr>
1695 * <tr>
1696 * <td align="center">INACTIVE</td>
1697 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1698 * <td align="center">LOCKED</td>
1699 * <td align="center">Values locked</td>
1700 * </tr>
1701 * <tr>
1702 * <td align="center">SEARCHING</td>
1703 * <td align="center">Camera device finishes AWB scan</td>
1704 * <td align="center">CONVERGED</td>
1705 * <td align="center">Good values, not changing</td>
1706 * </tr>
1707 * <tr>
1708 * <td align="center">SEARCHING</td>
1709 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1710 * <td align="center">LOCKED</td>
1711 * <td align="center">Values locked</td>
1712 * </tr>
1713 * <tr>
1714 * <td align="center">CONVERGED</td>
1715 * <td align="center">Camera device initiates AWB scan</td>
1716 * <td align="center">SEARCHING</td>
1717 * <td align="center">Values changing</td>
1718 * </tr>
1719 * <tr>
1720 * <td align="center">CONVERGED</td>
1721 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1722 * <td align="center">LOCKED</td>
1723 * <td align="center">Values locked</td>
1724 * </tr>
1725 * <tr>
1726 * <td align="center">LOCKED</td>
1727 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
1728 * <td align="center">SEARCHING</td>
1729 * <td align="center">Values not good after unlock</td>
1730 * </tr>
Zhijun He60b19dc2014-02-24 10:19:20 -08001731 * </tbody>
1732 * </table>
1733 * <p>For the above table, the camera device may skip reporting any state changes that happen
1734 * without application intervention (i.e. mode switch, trigger, locking). Any state that
1735 * can be skipped in that manner is called a transient state.</p>
1736 * <p>For example, for this AWB mode (AWB_MODE_AUTO), in addition to the state transitions
1737 * listed in above table, it is also legal for the camera device to skip one or more
1738 * transient states between two results. See below table for examples:</p>
1739 * <table>
1740 * <thead>
1741 * <tr>
1742 * <th align="center">State</th>
1743 * <th align="center">Transition Cause</th>
1744 * <th align="center">New State</th>
1745 * <th align="center">Notes</th>
1746 * </tr>
1747 * </thead>
1748 * <tbody>
1749 * <tr>
1750 * <td align="center">INACTIVE</td>
1751 * <td align="center">Camera device finished AWB scan</td>
1752 * <td align="center">CONVERGED</td>
1753 * <td align="center">Values are already good, transient states are skipped by camera device.</td>
1754 * </tr>
Zhijun He228f4f92014-01-16 17:22:05 -08001755 * <tr>
1756 * <td align="center">LOCKED</td>
1757 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
1758 * <td align="center">CONVERGED</td>
Zhijun He60b19dc2014-02-24 10:19:20 -08001759 * <td align="center">Values good after unlock, transient states are skipped by camera device.</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001760 * </tr>
1761 * </tbody>
1762 * </table>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001763 * <p><b>Possible values:</b>
1764 * <ul>
1765 * <li>{@link #CONTROL_AWB_STATE_INACTIVE INACTIVE}</li>
1766 * <li>{@link #CONTROL_AWB_STATE_SEARCHING SEARCHING}</li>
1767 * <li>{@link #CONTROL_AWB_STATE_CONVERGED CONVERGED}</li>
1768 * <li>{@link #CONTROL_AWB_STATE_LOCKED LOCKED}</li>
1769 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001770 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1771 * <p><b>Limited capability</b> -
1772 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1773 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001774 *
1775 * @see CaptureRequest#CONTROL_AWB_LOCK
1776 * @see CaptureRequest#CONTROL_AWB_MODE
1777 * @see CaptureRequest#CONTROL_MODE
1778 * @see CaptureRequest#CONTROL_SCENE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001779 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001780 * @see #CONTROL_AWB_STATE_INACTIVE
1781 * @see #CONTROL_AWB_STATE_SEARCHING
1782 * @see #CONTROL_AWB_STATE_CONVERGED
1783 * @see #CONTROL_AWB_STATE_LOCKED
1784 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001785 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001786 public static final Key<Integer> CONTROL_AWB_STATE =
1787 new Key<Integer>("android.control.awbState", int.class);
1788
1789 /**
Zhijun He379af012014-05-06 11:54:54 -07001790 * <p>A special color effect to apply.</p>
1791 * <p>When this mode is set, a color effect will be applied
1792 * to images produced by the camera device. The interpretation
1793 * and implementation of these color effects is left to the
1794 * implementor of the camera device, and should not be
1795 * depended on to be consistent (or present) across all
1796 * devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001797 * <p><b>Possible values:</b>
1798 * <ul>
1799 * <li>{@link #CONTROL_EFFECT_MODE_OFF OFF}</li>
1800 * <li>{@link #CONTROL_EFFECT_MODE_MONO MONO}</li>
1801 * <li>{@link #CONTROL_EFFECT_MODE_NEGATIVE NEGATIVE}</li>
1802 * <li>{@link #CONTROL_EFFECT_MODE_SOLARIZE SOLARIZE}</li>
1803 * <li>{@link #CONTROL_EFFECT_MODE_SEPIA SEPIA}</li>
1804 * <li>{@link #CONTROL_EFFECT_MODE_POSTERIZE POSTERIZE}</li>
1805 * <li>{@link #CONTROL_EFFECT_MODE_WHITEBOARD WHITEBOARD}</li>
1806 * <li>{@link #CONTROL_EFFECT_MODE_BLACKBOARD BLACKBOARD}</li>
1807 * <li>{@link #CONTROL_EFFECT_MODE_AQUA AQUA}</li>
1808 * </ul></p>
1809 * <p><b>Available values for this device:</b><br>
1810 * {@link CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS android.control.availableEffects}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001811 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001812 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001813 * @see CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS
Zhijun He379af012014-05-06 11:54:54 -07001814 * @see #CONTROL_EFFECT_MODE_OFF
1815 * @see #CONTROL_EFFECT_MODE_MONO
1816 * @see #CONTROL_EFFECT_MODE_NEGATIVE
1817 * @see #CONTROL_EFFECT_MODE_SOLARIZE
1818 * @see #CONTROL_EFFECT_MODE_SEPIA
1819 * @see #CONTROL_EFFECT_MODE_POSTERIZE
1820 * @see #CONTROL_EFFECT_MODE_WHITEBOARD
1821 * @see #CONTROL_EFFECT_MODE_BLACKBOARD
1822 * @see #CONTROL_EFFECT_MODE_AQUA
1823 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001824 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001825 public static final Key<Integer> CONTROL_EFFECT_MODE =
1826 new Key<Integer>("android.control.effectMode", int.class);
1827
1828 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001829 * <p>Overall mode of 3A (auto-exposure, auto-white-balance, auto-focus) control
Zhijun Hecc28a412014-02-24 15:11:23 -08001830 * routines.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001831 * <p>This is a top-level 3A control switch. When set to OFF, all 3A control
Zhijun He5f2a47f2014-01-16 15:44:41 -08001832 * by the camera device is disabled. The application must set the fields for
Zhijun Hef3537422013-12-16 16:56:35 -08001833 * capture parameters itself.</p>
1834 * <p>When set to AUTO, the individual algorithm controls in
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001835 * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p>
Zhijun Hef3537422013-12-16 16:56:35 -08001836 * <p>When set to USE_SCENE_MODE, the individual controls in
Zhijun He5f2a47f2014-01-16 15:44:41 -08001837 * android.control.* are mostly disabled, and the camera device implements
Zhijun Hef3537422013-12-16 16:56:35 -08001838 * one of the scene mode settings (such as ACTION, SUNSET, or PARTY)
Zhijun He5f2a47f2014-01-16 15:44:41 -08001839 * as it wishes. The camera device scene mode 3A settings are provided by
Zhijun Hef3537422013-12-16 16:56:35 -08001840 * android.control.sceneModeOverrides.</p>
Zhijun He2d5e8972014-02-07 16:13:46 -08001841 * <p>When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference
1842 * is that this frame will not be used by camera device background 3A statistics
1843 * update, as if this frame is never captured. This mode can be used in the scenario
1844 * where the application doesn't want a 3A manual control capture to affect
1845 * the subsequent auto 3A capture results.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001846 * <p>LEGACY mode devices will only support AUTO and USE_SCENE_MODE modes.
1847 * LIMITED mode devices will only support OFF and OFF_KEEP_STATE if they
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001848 * support the MANUAL_SENSOR and MANUAL_POST_PROCSESING capabilities.
1849 * FULL mode devices will always support OFF and OFF_KEEP_STATE.</p>
1850 * <p><b>Possible values:</b>
1851 * <ul>
1852 * <li>{@link #CONTROL_MODE_OFF OFF}</li>
1853 * <li>{@link #CONTROL_MODE_AUTO AUTO}</li>
1854 * <li>{@link #CONTROL_MODE_USE_SCENE_MODE USE_SCENE_MODE}</li>
1855 * <li>{@link #CONTROL_MODE_OFF_KEEP_STATE OFF_KEEP_STATE}</li>
1856 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001857 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001858 *
1859 * @see CaptureRequest#CONTROL_AF_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001860 * @see #CONTROL_MODE_OFF
1861 * @see #CONTROL_MODE_AUTO
1862 * @see #CONTROL_MODE_USE_SCENE_MODE
Zhijun He2d5e8972014-02-07 16:13:46 -08001863 * @see #CONTROL_MODE_OFF_KEEP_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001864 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001865 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001866 public static final Key<Integer> CONTROL_MODE =
1867 new Key<Integer>("android.control.mode", int.class);
1868
1869 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001870 * <p>Control for which scene mode is currently active.</p>
1871 * <p>Scene modes are custom camera modes optimized for a certain set of conditions and
1872 * capture settings.</p>
Zhijun He379af012014-05-06 11:54:54 -07001873 * <p>This is the mode that that is active when
1874 * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code>. Aside from FACE_PRIORITY,
1875 * these modes will disable {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode},
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001876 * {@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 -07001877 * <p>The interpretation and implementation of these scene modes is left
1878 * to the implementor of the camera device. Their behavior will not be
1879 * consistent across all devices, and any given device may only implement
1880 * a subset of these modes.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001881 * <p><b>Possible values:</b>
1882 * <ul>
1883 * <li>{@link #CONTROL_SCENE_MODE_DISABLED DISABLED}</li>
1884 * <li>{@link #CONTROL_SCENE_MODE_FACE_PRIORITY FACE_PRIORITY}</li>
1885 * <li>{@link #CONTROL_SCENE_MODE_ACTION ACTION}</li>
1886 * <li>{@link #CONTROL_SCENE_MODE_PORTRAIT PORTRAIT}</li>
1887 * <li>{@link #CONTROL_SCENE_MODE_LANDSCAPE LANDSCAPE}</li>
1888 * <li>{@link #CONTROL_SCENE_MODE_NIGHT NIGHT}</li>
1889 * <li>{@link #CONTROL_SCENE_MODE_NIGHT_PORTRAIT NIGHT_PORTRAIT}</li>
1890 * <li>{@link #CONTROL_SCENE_MODE_THEATRE THEATRE}</li>
1891 * <li>{@link #CONTROL_SCENE_MODE_BEACH BEACH}</li>
1892 * <li>{@link #CONTROL_SCENE_MODE_SNOW SNOW}</li>
1893 * <li>{@link #CONTROL_SCENE_MODE_SUNSET SUNSET}</li>
1894 * <li>{@link #CONTROL_SCENE_MODE_STEADYPHOTO STEADYPHOTO}</li>
1895 * <li>{@link #CONTROL_SCENE_MODE_FIREWORKS FIREWORKS}</li>
1896 * <li>{@link #CONTROL_SCENE_MODE_SPORTS SPORTS}</li>
1897 * <li>{@link #CONTROL_SCENE_MODE_PARTY PARTY}</li>
1898 * <li>{@link #CONTROL_SCENE_MODE_CANDLELIGHT CANDLELIGHT}</li>
1899 * <li>{@link #CONTROL_SCENE_MODE_BARCODE BARCODE}</li>
1900 * <li>{@link #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO HIGH_SPEED_VIDEO}</li>
1901 * </ul></p>
1902 * <p><b>Available values for this device:</b><br>
1903 * {@link CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES android.control.availableSceneModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001904 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001905 *
1906 * @see CaptureRequest#CONTROL_AE_MODE
1907 * @see CaptureRequest#CONTROL_AF_MODE
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001908 * @see CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES
Zhijun He379af012014-05-06 11:54:54 -07001909 * @see CaptureRequest#CONTROL_AWB_MODE
1910 * @see CaptureRequest#CONTROL_MODE
1911 * @see #CONTROL_SCENE_MODE_DISABLED
1912 * @see #CONTROL_SCENE_MODE_FACE_PRIORITY
1913 * @see #CONTROL_SCENE_MODE_ACTION
1914 * @see #CONTROL_SCENE_MODE_PORTRAIT
1915 * @see #CONTROL_SCENE_MODE_LANDSCAPE
1916 * @see #CONTROL_SCENE_MODE_NIGHT
1917 * @see #CONTROL_SCENE_MODE_NIGHT_PORTRAIT
1918 * @see #CONTROL_SCENE_MODE_THEATRE
1919 * @see #CONTROL_SCENE_MODE_BEACH
1920 * @see #CONTROL_SCENE_MODE_SNOW
1921 * @see #CONTROL_SCENE_MODE_SUNSET
1922 * @see #CONTROL_SCENE_MODE_STEADYPHOTO
1923 * @see #CONTROL_SCENE_MODE_FIREWORKS
1924 * @see #CONTROL_SCENE_MODE_SPORTS
1925 * @see #CONTROL_SCENE_MODE_PARTY
1926 * @see #CONTROL_SCENE_MODE_CANDLELIGHT
1927 * @see #CONTROL_SCENE_MODE_BARCODE
Zhijun Hee0404182014-06-26 13:17:09 -07001928 * @see #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO
Zhijun He379af012014-05-06 11:54:54 -07001929 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001930 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001931 public static final Key<Integer> CONTROL_SCENE_MODE =
1932 new Key<Integer>("android.control.sceneMode", int.class);
1933
1934 /**
1935 * <p>Whether video stabilization is
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001936 * active.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001937 * <p>Video stabilization automatically translates and scales images from
1938 * the camera in order to stabilize motion between consecutive frames.</p>
Zhijun He379af012014-05-06 11:54:54 -07001939 * <p>If enabled, video stabilization can modify the
Zhijun He45fa43a12014-06-13 18:29:37 -07001940 * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to keep the video stream stabilized.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001941 * <p>Switching between different video stabilization modes may take several
1942 * frames to initialize, the camera device will report the current mode
1943 * in capture result metadata. For example, When "ON" mode is requested,
1944 * the video stabilization modes in the first several capture results may
1945 * still be "OFF", and it will become "ON" when the initialization is
1946 * done.</p>
1947 * <p>If a camera device supports both this mode and OIS
1948 * ({@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}), turning both modes on may
1949 * produce undesirable interaction, so it is recommended not to enable
1950 * both at the same time.</p>
1951 * <p><b>Possible values:</b>
1952 * <ul>
1953 * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_OFF OFF}</li>
1954 * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_ON ON}</li>
1955 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001956 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001957 *
Zhijun He45fa43a12014-06-13 18:29:37 -07001958 * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
Zhijun He379af012014-05-06 11:54:54 -07001959 * @see CaptureRequest#SCALER_CROP_REGION
1960 * @see #CONTROL_VIDEO_STABILIZATION_MODE_OFF
1961 * @see #CONTROL_VIDEO_STABILIZATION_MODE_ON
1962 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001963 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001964 public static final Key<Integer> CONTROL_VIDEO_STABILIZATION_MODE =
1965 new Key<Integer>("android.control.videoStabilizationMode", int.class);
1966
1967 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08001968 * <p>Operation mode for edge
Zhijun Hecc28a412014-02-24 15:11:23 -08001969 * enhancement.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001970 * <p>Edge enhancement improves sharpness and details in the captured image. OFF means
1971 * no enhancement will be applied by the camera device.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08001972 * <p>FAST/HIGH_QUALITY both mean camera device determined enhancement
Zhijun He28079362013-12-17 10:35:40 -08001973 * will be applied. HIGH_QUALITY mode indicates that the
Zhijun He5f2a47f2014-01-16 15:44:41 -08001974 * camera device will use the highest-quality enhancement algorithms,
1975 * even if it slows down capture rate. FAST means the camera device will
Zhijun He28079362013-12-17 10:35:40 -08001976 * not slow down capture rate when applying edge enhancement.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001977 * <p><b>Possible values:</b>
1978 * <ul>
1979 * <li>{@link #EDGE_MODE_OFF OFF}</li>
1980 * <li>{@link #EDGE_MODE_FAST FAST}</li>
1981 * <li>{@link #EDGE_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
1982 * </ul></p>
1983 * <p><b>Available values for this device:</b><br>
1984 * {@link CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES android.edge.availableEdgeModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001985 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1986 * <p><b>Full capability</b> -
1987 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1988 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08001989 *
1990 * @see CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001991 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001992 * @see #EDGE_MODE_OFF
1993 * @see #EDGE_MODE_FAST
1994 * @see #EDGE_MODE_HIGH_QUALITY
1995 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001996 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001997 public static final Key<Integer> EDGE_MODE =
1998 new Key<Integer>("android.edge.mode", int.class);
1999
2000 /**
Zhijun He66d065a2014-01-16 18:18:50 -08002001 * <p>The desired mode for for the camera device's flash control.</p>
2002 * <p>This control is only effective when flash unit is available
Zhijun He153ac102014-02-03 12:25:12 -08002003 * (<code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == true</code>).</p>
Zhijun He66d065a2014-01-16 18:18:50 -08002004 * <p>When this control is used, the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} must be set to ON or OFF.
2005 * Otherwise, the camera device auto-exposure related flash control (ON_AUTO_FLASH,
2006 * ON_ALWAYS_FLASH, or ON_AUTO_FLASH_REDEYE) will override this control.</p>
2007 * <p>When set to OFF, the camera device will not fire flash for this capture.</p>
2008 * <p>When set to SINGLE, the camera device will fire flash regardless of the camera
2009 * device's auto-exposure routine's result. When used in still capture case, this
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002010 * control should be used along with auto-exposure (AE) precapture metering sequence
Zhijun He66d065a2014-01-16 18:18:50 -08002011 * ({@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}), otherwise, the image may be incorrectly exposed.</p>
2012 * <p>When set to TORCH, the flash will be on continuously. This mode can be used
2013 * for use cases such as preview, auto-focus assist, still capture, or video recording.</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002014 * <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 -07002015 * <p><b>Possible values:</b>
2016 * <ul>
2017 * <li>{@link #FLASH_MODE_OFF OFF}</li>
2018 * <li>{@link #FLASH_MODE_SINGLE SINGLE}</li>
2019 * <li>{@link #FLASH_MODE_TORCH TORCH}</li>
2020 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002021 * <p>This key is available on all devices.</p>
Zhijun He66d065a2014-01-16 18:18:50 -08002022 *
2023 * @see CaptureRequest#CONTROL_AE_MODE
2024 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
2025 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
Zhijun Heca1b73a2014-02-03 12:39:53 -08002026 * @see CaptureResult#FLASH_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002027 * @see #FLASH_MODE_OFF
2028 * @see #FLASH_MODE_SINGLE
2029 * @see #FLASH_MODE_TORCH
2030 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002031 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002032 public static final Key<Integer> FLASH_MODE =
2033 new Key<Integer>("android.flash.mode", int.class);
2034
2035 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002036 * <p>Current state of the flash
Zhijun Heca1b73a2014-02-03 12:39:53 -08002037 * unit.</p>
2038 * <p>When the camera device doesn't have flash unit
2039 * (i.e. <code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == false</code>), this state will always be UNAVAILABLE.
2040 * Other states indicate the current flash status.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002041 * <p>In certain conditions, this will be available on LEGACY devices:</p>
2042 * <ul>
2043 * <li>Flash-less cameras always return UNAVAILABLE.</li>
2044 * <li>Using {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>==</code> ON_ALWAYS_FLASH
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002045 * will always return FIRED.</li>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002046 * <li>Using {@link CaptureRequest#FLASH_MODE android.flash.mode} <code>==</code> TORCH
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002047 * will always return FIRED.</li>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002048 * </ul>
2049 * <p>In all other conditions the state will not be available on
2050 * LEGACY devices (i.e. it will be <code>null</code>).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002051 * <p><b>Possible values:</b>
2052 * <ul>
2053 * <li>{@link #FLASH_STATE_UNAVAILABLE UNAVAILABLE}</li>
2054 * <li>{@link #FLASH_STATE_CHARGING CHARGING}</li>
2055 * <li>{@link #FLASH_STATE_READY READY}</li>
2056 * <li>{@link #FLASH_STATE_FIRED FIRED}</li>
2057 * <li>{@link #FLASH_STATE_PARTIAL PARTIAL}</li>
2058 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002059 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2060 * <p><b>Limited capability</b> -
2061 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2062 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002063 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002064 * @see CaptureRequest#CONTROL_AE_MODE
Zhijun Heca1b73a2014-02-03 12:39:53 -08002065 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002066 * @see CaptureRequest#FLASH_MODE
2067 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002068 * @see #FLASH_STATE_UNAVAILABLE
2069 * @see #FLASH_STATE_CHARGING
2070 * @see #FLASH_STATE_READY
2071 * @see #FLASH_STATE_FIRED
Zhijun He8dda7272014-03-25 13:49:30 -07002072 * @see #FLASH_STATE_PARTIAL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002073 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002074 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002075 public static final Key<Integer> FLASH_STATE =
2076 new Key<Integer>("android.flash.state", int.class);
2077
2078 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002079 * <p>Operational mode for hot pixel correction.</p>
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002080 * <p>Hotpixel correction interpolates out, or otherwise removes, pixels
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002081 * that do not accurately measure the incoming light (i.e. pixels that
2082 * are stuck at an arbitrary value or are oversensitive).</p>
2083 * <p><b>Possible values:</b>
2084 * <ul>
2085 * <li>{@link #HOT_PIXEL_MODE_OFF OFF}</li>
2086 * <li>{@link #HOT_PIXEL_MODE_FAST FAST}</li>
2087 * <li>{@link #HOT_PIXEL_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
2088 * </ul></p>
2089 * <p><b>Available values for this device:</b><br>
2090 * {@link CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES android.hotPixel.availableHotPixelModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002091 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002092 *
2093 * @see CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002094 * @see #HOT_PIXEL_MODE_OFF
2095 * @see #HOT_PIXEL_MODE_FAST
2096 * @see #HOT_PIXEL_MODE_HIGH_QUALITY
2097 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002098 @PublicKey
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002099 public static final Key<Integer> HOT_PIXEL_MODE =
2100 new Key<Integer>("android.hotPixel.mode", int.class);
2101
2102 /**
Ruben Brunk57493682014-05-27 18:58:08 -07002103 * <p>A location object to use when generating image GPS metadata.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002104 * <p>Setting a location object in a request will include the GPS coordinates of the location
2105 * into any JPEG images captured based on the request. These coordinates can then be
2106 * viewed by anyone who receives the JPEG image.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002107 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002108 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002109 @PublicKey
2110 @SyntheticKey
Ruben Brunk57493682014-05-27 18:58:08 -07002111 public static final Key<android.location.Location> JPEG_GPS_LOCATION =
2112 new Key<android.location.Location>("android.jpeg.gpsLocation", android.location.Location.class);
2113
2114 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002115 * <p>GPS coordinates to include in output JPEG
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002116 * EXIF.</p>
2117 * <p><b>Range of valid values:</b><br>
2118 * (-180 - 180], [-90,90], [-inf, inf]</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002119 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002120 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002121 */
2122 public static final Key<double[]> JPEG_GPS_COORDINATES =
2123 new Key<double[]>("android.jpeg.gpsCoordinates", double[].class);
2124
2125 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002126 * <p>32 characters describing GPS algorithm to
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002127 * include in EXIF.</p>
2128 * <p><b>Units</b>: UTF-8 null-terminated string</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002129 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002130 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002131 */
2132 public static final Key<String> JPEG_GPS_PROCESSING_METHOD =
2133 new Key<String>("android.jpeg.gpsProcessingMethod", String.class);
2134
2135 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002136 * <p>Time GPS fix was made to include in
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002137 * EXIF.</p>
2138 * <p><b>Units</b>: UTC in seconds since January 1, 1970</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002139 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002140 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002141 */
2142 public static final Key<Long> JPEG_GPS_TIMESTAMP =
2143 new Key<Long>("android.jpeg.gpsTimestamp", long.class);
2144
2145 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002146 * <p>The orientation for a JPEG image.</p>
2147 * <p>The clockwise rotation angle in degrees, relative to the orientation
2148 * to the camera, that the JPEG picture needs to be rotated by, to be viewed
2149 * upright.</p>
2150 * <p>Camera devices may either encode this value into the JPEG EXIF header, or
2151 * rotate the image data to match this orientation.</p>
2152 * <p>Note that this orientation is relative to the orientation of the camera sensor, given
2153 * by {@link CameraCharacteristics#SENSOR_ORIENTATION android.sensor.orientation}.</p>
2154 * <p>To translate from the device orientation given by the Android sensor APIs, the following
2155 * sample code may be used:</p>
2156 * <pre><code>private int getJpegOrientation(CameraCharacteristics c, int deviceOrientation) {
2157 * if (deviceOrientation == android.view.OrientationEventListener.ORIENTATION_UNKNOWN) return 0;
2158 * int sensorOrientation = c.get(CameraCharacteristics.SENSOR_ORIENTATION);
2159 *
2160 * // Round device orientation to a multiple of 90
2161 * deviceOrientation = (deviceOrientation + 45) / 90 * 90;
2162 *
2163 * // Reverse device orientation for front-facing cameras
2164 * boolean facingFront = c.get(CameraCharacteristics.LENS_FACING) == CameraCharacteristics.LENS_FACING_FRONT;
2165 * if (facingFront) deviceOrientation = -deviceOrientation;
2166 *
2167 * // Calculate desired JPEG orientation relative to camera orientation to make
2168 * // the image upright relative to the device orientation
2169 * int jpegOrientation = (sensorOrientation + deviceOrientation + 360) % 360;
2170 *
2171 * return jpegOrientation;
2172 * }
2173 * </code></pre>
2174 * <p><b>Units</b>: Degrees in multiples of 90</p>
2175 * <p><b>Range of valid values:</b><br>
2176 * 0, 90, 180, 270</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002177 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002178 *
2179 * @see CameraCharacteristics#SENSOR_ORIENTATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002180 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002181 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002182 public static final Key<Integer> JPEG_ORIENTATION =
2183 new Key<Integer>("android.jpeg.orientation", int.class);
2184
2185 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002186 * <p>Compression quality of the final JPEG
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002187 * image.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002188 * <p>85-95 is typical usage range.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002189 * <p><b>Range of valid values:</b><br>
2190 * 1-100; larger is higher quality</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002191 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002192 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002193 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002194 public static final Key<Byte> JPEG_QUALITY =
2195 new Key<Byte>("android.jpeg.quality", byte.class);
2196
2197 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002198 * <p>Compression quality of JPEG
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002199 * thumbnail.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002200 * <p><b>Range of valid values:</b><br>
2201 * 1-100; larger is higher quality</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002202 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002203 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002204 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002205 public static final Key<Byte> JPEG_THUMBNAIL_QUALITY =
2206 new Key<Byte>("android.jpeg.thumbnailQuality", byte.class);
2207
2208 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002209 * <p>Resolution of embedded JPEG thumbnail.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08002210 * <p>When set to (0, 0) value, the JPEG EXIF will not contain thumbnail,
2211 * but the captured JPEG will still be a valid image.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002212 * <p>For best results, when issuing a request for a JPEG image, the thumbnail size selected
2213 * should have the same aspect ratio as the main JPEG output.</p>
Zhijun He50f72432014-05-28 13:52:04 -07002214 * <p>If the thumbnail image aspect ratio differs from the JPEG primary image aspect
2215 * ratio, the camera device creates the thumbnail by cropping it from the primary image.
2216 * For example, if the primary image has 4:3 aspect ratio, the thumbnail image has
2217 * 16:9 aspect ratio, the primary image will be cropped vertically (letterbox) to
2218 * generate the thumbnail image. The thumbnail image will always have a smaller Field
2219 * Of View (FOV) than the primary image when aspect ratios differ.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002220 * <p><b>Range of valid values:</b><br>
2221 * {@link CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES android.jpeg.availableThumbnailSizes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002222 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002223 *
2224 * @see CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002225 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002226 @PublicKey
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07002227 public static final Key<android.util.Size> JPEG_THUMBNAIL_SIZE =
2228 new Key<android.util.Size>("android.jpeg.thumbnailSize", android.util.Size.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002229
2230 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002231 * <p>The desired lens aperture size, as a ratio of lens focal length to the
2232 * effective aperture diameter.</p>
2233 * <p>Setting this value is only supported on the camera devices that have a variable
2234 * aperture lens.</p>
Zhijun Hefb46c642014-01-14 17:57:23 -08002235 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF,
2236 * this can be set along with {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002237 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}
Zhijun Hefb46c642014-01-14 17:57:23 -08002238 * to achieve manual exposure control.</p>
2239 * <p>The requested aperture value may take several frames to reach the
2240 * requested value; the camera device will report the current (intermediate)
Zhijun Heca1b73a2014-02-03 12:39:53 -08002241 * aperture size in capture result metadata while the aperture is changing.
2242 * 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 -08002243 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of
2244 * the ON modes, this will be overridden by the camera device
2245 * auto-exposure algorithm, the overridden values are then provided
2246 * back to the user in the corresponding result.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002247 * <p><b>Units</b>: The f-number (f/N)</p>
2248 * <p><b>Range of valid values:</b><br>
2249 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002250 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2251 * <p><b>Full capability</b> -
2252 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2253 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Hefb46c642014-01-14 17:57:23 -08002254 *
Zhijun He399f05d2014-01-15 11:31:30 -08002255 * @see CaptureRequest#CONTROL_AE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002256 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002257 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
Zhijun Heca1b73a2014-02-03 12:39:53 -08002258 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002259 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002260 * @see CaptureRequest#SENSOR_FRAME_DURATION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002261 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002262 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002263 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002264 public static final Key<Float> LENS_APERTURE =
2265 new Key<Float>("android.lens.aperture", float.class);
2266
2267 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002268 * <p>The desired setting for the lens neutral density filter(s).</p>
2269 * <p>This control will not be supported on most camera devices.</p>
Ruben Brunk855bae42014-01-17 10:30:32 -08002270 * <p>Lens filters are typically used to lower the amount of light the
2271 * sensor is exposed to (measured in steps of EV). As used here, an EV
2272 * step is the standard logarithmic representation, which are
2273 * non-negative, and inversely proportional to the amount of light
2274 * hitting the sensor. For example, setting this to 0 would result
2275 * in no reduction of the incoming light, and setting this to 2 would
2276 * mean that the filter is set to reduce incoming light by two stops
2277 * (allowing 1/4 of the prior amount of light to the sensor).</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002278 * <p>It may take several frames before the lens filter density changes
2279 * to the requested value. While the filter density is still changing,
2280 * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002281 * <p><b>Units</b>: Exposure Value (EV)</p>
2282 * <p><b>Range of valid values:</b><br>
2283 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002284 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2285 * <p><b>Full capability</b> -
2286 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2287 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk855bae42014-01-17 10:30:32 -08002288 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002289 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk855bae42014-01-17 10:30:32 -08002290 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
Zhijun Heca1b73a2014-02-03 12:39:53 -08002291 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002292 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002293 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002294 public static final Key<Float> LENS_FILTER_DENSITY =
2295 new Key<Float>("android.lens.filterDensity", float.class);
2296
2297 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002298 * <p>The desired lens focal length; used for optical zoom.</p>
Ruben Brunka20f4c22014-01-17 15:21:13 -08002299 * <p>This setting controls the physical focal length of the camera
2300 * device's lens. Changing the focal length changes the field of
2301 * view of the camera device, and is usually used for optical zoom.</p>
2302 * <p>Like {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, this
2303 * setting won't be applied instantaneously, and it may take several
Zhijun Heca1b73a2014-02-03 12:39:53 -08002304 * frames before the lens can change to the requested focal length.
Ruben Brunka20f4c22014-01-17 15:21:13 -08002305 * While the focal length is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will
2306 * be set to MOVING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002307 * <p>Optical zoom will not be supported on most devices.</p>
2308 * <p><b>Units</b>: Millimeters</p>
2309 * <p><b>Range of valid values:</b><br>
2310 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002311 * <p>This key is available on all devices.</p>
Ruben Brunka20f4c22014-01-17 15:21:13 -08002312 *
2313 * @see CaptureRequest#LENS_APERTURE
2314 * @see CaptureRequest#LENS_FOCUS_DISTANCE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002315 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS
Ruben Brunka20f4c22014-01-17 15:21:13 -08002316 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002317 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002318 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002319 public static final Key<Float> LENS_FOCAL_LENGTH =
2320 new Key<Float>("android.lens.focalLength", float.class);
2321
2322 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002323 * <p>Desired distance to plane of sharpest focus,
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002324 * measured from frontmost surface of the lens.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002325 * <p>Should be zero for fixed-focus cameras</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002326 * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p>
2327 * <p><b>Range of valid values:</b><br>
2328 * &gt;= 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002329 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2330 * <p><b>Full capability</b> -
2331 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2332 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2333 *
2334 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002335 * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002336 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002337 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002338 public static final Key<Float> LENS_FOCUS_DISTANCE =
2339 new Key<Float>("android.lens.focusDistance", float.class);
2340
2341 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002342 * <p>The range of scene distances that are in
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002343 * sharp focus (depth of field).</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002344 * <p>If variable focus not supported, can still report
2345 * fixed depth of field range</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002346 * <p><b>Units</b>: A pair of focus distances in diopters: (near,
2347 * far); see {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details.</p>
2348 * <p><b>Range of valid values:</b><br>
2349 * &gt;=0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002350 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2351 * <p><b>Limited capability</b> -
2352 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2353 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2354 *
2355 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002356 * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002357 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002358 @PublicKey
Igor Murashkin57438682014-05-30 10:49:00 -07002359 public static final Key<android.util.Pair<Float,Float>> LENS_FOCUS_RANGE =
2360 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 -07002361
2362 /**
Ruben Brunk00849b32014-01-17 18:30:23 -08002363 * <p>Sets whether the camera device uses optical image stabilization (OIS)
2364 * when capturing images.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002365 * <p>OIS is used to compensate for motion blur due to small
2366 * movements of the camera during capture. Unlike digital image
2367 * stabilization ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), OIS
2368 * makes use of mechanical elements to stabilize the camera
2369 * sensor, and thus allows for longer exposure times before
2370 * camera shake becomes apparent.</p>
Zhijun He45fa43a12014-06-13 18:29:37 -07002371 * <p>Switching between different optical stabilization modes may take several
2372 * frames to initialize, the camera device will report the current mode in
2373 * capture result metadata. For example, When "ON" mode is requested, the
2374 * optical stabilization modes in the first several capture results may still
2375 * be "OFF", and it will become "ON" when the initialization is done.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002376 * <p>If a camera device supports both OIS and digital image stabilization
2377 * ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), turning both modes on may produce undesirable
2378 * interaction, so it is recommended not to enable both at the same time.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002379 * <p>Not all devices will support OIS; see
2380 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization} for
2381 * available controls.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002382 * <p><b>Possible values:</b>
2383 * <ul>
2384 * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_OFF OFF}</li>
2385 * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_ON ON}</li>
2386 * </ul></p>
2387 * <p><b>Available values for this device:</b><br>
2388 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002389 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2390 * <p><b>Limited capability</b> -
2391 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2392 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002393 *
2394 * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002395 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002396 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002397 * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF
2398 * @see #LENS_OPTICAL_STABILIZATION_MODE_ON
2399 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002400 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002401 public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE =
2402 new Key<Integer>("android.lens.opticalStabilizationMode", int.class);
2403
2404 /**
Zhijun Heca1b73a2014-02-03 12:39:53 -08002405 * <p>Current lens status.</p>
2406 * <p>For lens parameters {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}, {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance},
2407 * {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, when changes are requested,
2408 * they may take several frames to reach the requested values. This state indicates
2409 * the current status of the lens parameters.</p>
2410 * <p>When the state is STATIONARY, the lens parameters are not changing. This could be
2411 * either because the parameters are all fixed, or because the lens has had enough
2412 * time to reach the most recently-requested values.
2413 * If all these lens parameters are not changable for a camera device, as listed below:</p>
2414 * <ul>
2415 * <li>Fixed focus (<code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} == 0</code>), which means
2416 * {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} parameter will always be 0.</li>
2417 * <li>Fixed focal length ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths} contains single value),
2418 * which means the optical zoom is not supported.</li>
2419 * <li>No ND filter ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities} contains only 0).</li>
2420 * <li>Fixed aperture ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures} contains single value).</li>
2421 * </ul>
2422 * <p>Then this state will always be STATIONARY.</p>
2423 * <p>When the state is MOVING, it indicates that at least one of the lens parameters
2424 * is changing.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002425 * <p><b>Possible values:</b>
2426 * <ul>
2427 * <li>{@link #LENS_STATE_STATIONARY STATIONARY}</li>
2428 * <li>{@link #LENS_STATE_MOVING MOVING}</li>
2429 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002430 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2431 * <p><b>Limited capability</b> -
2432 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2433 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002434 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002435 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun Heca1b73a2014-02-03 12:39:53 -08002436 * @see CaptureRequest#LENS_APERTURE
2437 * @see CaptureRequest#LENS_FILTER_DENSITY
2438 * @see CaptureRequest#LENS_FOCAL_LENGTH
2439 * @see CaptureRequest#LENS_FOCUS_DISTANCE
2440 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
2441 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
2442 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS
2443 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002444 * @see #LENS_STATE_STATIONARY
Igor Murashkin9ea4ae62013-09-11 21:40:11 -07002445 * @see #LENS_STATE_MOVING
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002446 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002447 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002448 public static final Key<Integer> LENS_STATE =
2449 new Key<Integer>("android.lens.state", int.class);
2450
2451 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002452 * <p>Mode of operation for the noise reduction algorithm.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002453 * <p>The noise reduction algorithm attempts to improve image quality by removing
2454 * excessive noise added by the capture process, especially in dark conditions.
2455 * OFF means no noise reduction will be applied by the camera device.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08002456 * <p>FAST/HIGH_QUALITY both mean camera device determined noise filtering
2457 * will be applied. HIGH_QUALITY mode indicates that the camera device
2458 * will use the highest-quality noise filtering algorithms,
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002459 * even if it slows down capture rate. FAST means the camera device will not
Zhijun He28079362013-12-17 10:35:40 -08002460 * slow down capture rate when applying noise filtering.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002461 * <p><b>Possible values:</b>
2462 * <ul>
2463 * <li>{@link #NOISE_REDUCTION_MODE_OFF OFF}</li>
2464 * <li>{@link #NOISE_REDUCTION_MODE_FAST FAST}</li>
2465 * <li>{@link #NOISE_REDUCTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
2466 * </ul></p>
2467 * <p><b>Available values for this device:</b><br>
2468 * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002469 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2470 * <p><b>Full capability</b> -
2471 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2472 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002473 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002474 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002475 * @see CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002476 * @see #NOISE_REDUCTION_MODE_OFF
2477 * @see #NOISE_REDUCTION_MODE_FAST
2478 * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY
2479 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002480 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002481 public static final Key<Integer> NOISE_REDUCTION_MODE =
2482 new Key<Integer>("android.noiseReduction.mode", int.class);
2483
2484 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002485 * <p>Whether a result given to the framework is the
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002486 * final one for the capture, or only a partial that contains a
2487 * subset of the full set of dynamic metadata
Igor Murashkinace5bf02013-12-10 17:36:40 -08002488 * values.</p>
2489 * <p>The entries in the result metadata buffers for a
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002490 * single capture may not overlap, except for this entry. The
2491 * FINAL buffers must retain FIFO ordering relative to the
2492 * requests that generate them, so the FINAL buffer for frame 3 must
2493 * always be sent to the framework after the FINAL buffer for frame 2, and
2494 * before the FINAL buffer for frame 4. PARTIAL buffers may be returned
2495 * in any order relative to other frames, but all PARTIAL buffers for a given
2496 * capture must arrive before the FINAL buffer for that capture. This entry may
Zhijun Hecc28a412014-02-24 15:11:23 -08002497 * only be used by the camera device if quirks.usePartialResult is set to 1.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002498 * <p><b>Range of valid values:</b><br>
2499 * Optional. Default value is FINAL.</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08002500 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07002501 * @deprecated
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002502 * @hide
2503 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002504 @Deprecated
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002505 public static final Key<Boolean> QUIRKS_PARTIAL_RESULT =
2506 new Key<Boolean>("android.quirks.partialResult", boolean.class);
2507
2508 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002509 * <p>A frame counter set by the framework. This value monotonically
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -07002510 * increases with every new result (that is, each new result has a unique
Igor Murashkinace5bf02013-12-10 17:36:40 -08002511 * frameCount value).</p>
2512 * <p>Reset on release()</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002513 * <p><b>Units</b>: count of frames</p>
2514 * <p><b>Range of valid values:</b><br>
2515 * &gt; 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002516 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkinbdf366c2014-07-25 16:54:20 -07002517 * @deprecated
2518 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002519 */
Igor Murashkinbdf366c2014-07-25 16:54:20 -07002520 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002521 public static final Key<Integer> REQUEST_FRAME_COUNT =
2522 new Key<Integer>("android.request.frameCount", int.class);
2523
2524 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002525 * <p>An application-specified ID for the current
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002526 * request. Must be maintained unchanged in output
Igor Murashkinace5bf02013-12-10 17:36:40 -08002527 * frame</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002528 * <p><b>Units</b>: arbitrary integer assigned by application</p>
2529 * <p><b>Range of valid values:</b><br>
2530 * Any int</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002531 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002532 * @hide
2533 */
2534 public static final Key<Integer> REQUEST_ID =
2535 new Key<Integer>("android.request.id", int.class);
2536
2537 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08002538 * <p>Specifies the number of pipeline stages the frame went
2539 * through from when it was exposed to when the final completed result
2540 * was available to the framework.</p>
2541 * <p>Depending on what settings are used in the request, and
2542 * what streams are configured, the data may undergo less processing,
2543 * and some pipeline stages skipped.</p>
2544 * <p>See {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} for more details.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002545 * <p><b>Range of valid values:</b><br>
2546 * &lt;= {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002547 * <p>This key is available on all devices.</p>
Igor Murashkinc127f052014-01-17 18:06:02 -08002548 *
2549 * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
2550 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002551 @PublicKey
Igor Murashkinc127f052014-01-17 18:06:02 -08002552 public static final Key<Byte> REQUEST_PIPELINE_DEPTH =
2553 new Key<Byte>("android.request.pipelineDepth", byte.class);
2554
2555 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002556 * <p>The desired region of the sensor to read out for this capture.</p>
2557 * <p>This control can be used to implement digital zoom.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002558 * <p>The crop region coordinate system is based off
2559 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being the
2560 * top-left corner of the sensor active array.</p>
2561 * <p>Output streams use this rectangle to produce their output,
2562 * cropping to a smaller region if necessary to maintain the
2563 * stream's aspect ratio, then scaling the sensor input to
2564 * match the output's configured resolution.</p>
2565 * <p>The crop region is applied after the RAW to other color
2566 * space (e.g. YUV) conversion. Since raw streams
2567 * (e.g. RAW16) don't have the conversion stage, they are not
2568 * croppable. The crop region will be ignored by raw streams.</p>
Zhijun He9e6d1882014-05-22 16:47:35 -07002569 * <p>For non-raw streams, any additional per-stream cropping will
2570 * be done to maximize the final pixel area of the stream.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002571 * <p>For example, if the crop region is set to a 4:3 aspect
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002572 * ratio, then 4:3 streams will use the exact crop
2573 * region. 16:9 streams will further crop vertically
Igor Murashkinace5bf02013-12-10 17:36:40 -08002574 * (letterbox).</p>
2575 * <p>Conversely, if the crop region is set to a 16:9, then 4:3
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002576 * outputs will crop horizontally (pillarbox), and 16:9
2577 * streams will match exactly. These additional crops will
Igor Murashkinace5bf02013-12-10 17:36:40 -08002578 * be centered within the crop region.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002579 * <p>The width and height of the crop region cannot
2580 * be set to be smaller than
2581 * <code>floor( activeArraySize.width / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code> and
2582 * <code>floor( activeArraySize.height / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code>, respectively.</p>
2583 * <p>The camera device may adjust the crop region to account
2584 * for rounding and other hardware requirements; the final
2585 * crop region used will be included in the output capture
2586 * result.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002587 * <p><b>Units</b>: Pixel coordinates relative to
2588 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002589 * <p>This key is available on all devices.</p>
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002590 *
2591 * @see CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002592 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002593 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002594 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002595 public static final Key<android.graphics.Rect> SCALER_CROP_REGION =
2596 new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class);
2597
2598 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002599 * <p>Duration each pixel is exposed to
2600 * light.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002601 * <p>If the sensor can't expose this exact duration, it will shorten the
2602 * duration exposed to the nearest possible value (rather than expose longer).
2603 * The final exposure time used will be available in the output capture result.</p>
2604 * <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
2605 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
2606 * <p><b>Units</b>: Nanoseconds</p>
2607 * <p><b>Range of valid values:</b><br>
2608 * {@link CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE android.sensor.info.exposureTimeRange}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002609 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2610 * <p><b>Full capability</b> -
2611 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2612 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2613 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002614 * @see CaptureRequest#CONTROL_AE_MODE
2615 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002616 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002617 * @see CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002618 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002619 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002620 public static final Key<Long> SENSOR_EXPOSURE_TIME =
2621 new Key<Long>("android.sensor.exposureTime", long.class);
2622
2623 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002624 * <p>Duration from start of frame exposure to
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002625 * start of next frame exposure.</p>
2626 * <p>The maximum frame rate that can be supported by a camera subsystem is
2627 * a function of many factors:</p>
2628 * <ul>
2629 * <li>Requested resolutions of output image streams</li>
2630 * <li>Availability of binning / skipping modes on the imager</li>
2631 * <li>The bandwidth of the imager interface</li>
2632 * <li>The bandwidth of the various ISP processing blocks</li>
2633 * </ul>
2634 * <p>Since these factors can vary greatly between different ISPs and
2635 * sensors, the camera abstraction tries to represent the bandwidth
2636 * restrictions with as simple a model as possible.</p>
2637 * <p>The model presented has the following characteristics:</p>
2638 * <ul>
2639 * <li>The image sensor is always configured to output the smallest
2640 * resolution possible given the application's requested output stream
2641 * sizes. The smallest resolution is defined as being at least as large
2642 * as the largest requested output stream size; the camera pipeline must
2643 * never digitally upsample sensor data when the crop region covers the
2644 * whole sensor. In general, this means that if only small output stream
2645 * resolutions are configured, the sensor can provide a higher frame
2646 * rate.</li>
2647 * <li>Since any request may use any or all the currently configured
2648 * output streams, the sensor and ISP must be configured to support
2649 * scaling a single capture to all the streams at the same time. This
2650 * means the camera pipeline must be ready to produce the largest
2651 * requested output size without any delay. Therefore, the overall
2652 * frame rate of a given configured stream set is governed only by the
2653 * largest requested stream resolution.</li>
2654 * <li>Using more than one output stream in a request does not affect the
2655 * frame duration.</li>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002656 * <li>Certain format-streams may need to do additional background processing
2657 * before data is consumed/produced by that stream. These processors
2658 * can run concurrently to the rest of the camera pipeline, but
2659 * cannot process more than 1 capture at a time.</li>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002660 * </ul>
2661 * <p>The necessary information for the application, given the model above,
Igor Murashkin9c595172014-05-12 13:56:20 -07002662 * is provided via the {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} field
2663 * using StreamConfigurationMap#getOutputMinFrameDuration(int, Size).
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002664 * These are used to determine the maximum frame rate / minimum frame
2665 * duration that is possible for a given stream configuration.</p>
2666 * <p>Specifically, the application can use the following rules to
Igor Murashkina23ffb52014-02-07 18:52:34 -08002667 * determine the minimum frame duration it can request from the camera
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002668 * device:</p>
2669 * <ol>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002670 * <li>Let the set of currently configured input/output streams
2671 * be called <code>S</code>.</li>
2672 * <li>Find the minimum frame durations for each stream in <code>S</code>, by
Igor Murashkin9c595172014-05-12 13:56:20 -07002673 * looking it up in {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} using
2674 * StreamConfigurationMap#getOutputMinFrameDuration(int, Size) (with
Igor Murashkina23ffb52014-02-07 18:52:34 -08002675 * its respective size/format). Let this set of frame durations be called
2676 * <code>F</code>.</li>
2677 * <li>For any given request <code>R</code>, the minimum frame duration allowed
2678 * for <code>R</code> is the maximum out of all values in <code>F</code>. Let the streams
2679 * used in <code>R</code> be called <code>S_r</code>.</li>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002680 * </ol>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002681 * <p>If none of the streams in <code>S_r</code> have a stall time (listed in
Igor Murashkin9c595172014-05-12 13:56:20 -07002682 * StreamConfigurationMap#getOutputStallDuration(int,Size) using its
2683 * respective size/format), then the frame duration in
Igor Murashkina23ffb52014-02-07 18:52:34 -08002684 * <code>F</code> determines the steady state frame rate that the application will
2685 * get if it uses <code>R</code> as a repeating request. Let this special kind
2686 * of request be called <code>Rsimple</code>.</p>
2687 * <p>A repeating request <code>Rsimple</code> can be <em>occasionally</em> interleaved
2688 * by a single capture of a new request <code>Rstall</code> (which has at least
2689 * one in-use stream with a non-0 stall time) and if <code>Rstall</code> has the
2690 * same minimum frame duration this will not cause a frame rate loss
2691 * if all buffers from the previous <code>Rstall</code> have already been
2692 * delivered.</p>
2693 * <p>For more details about stalling, see
Igor Murashkin9c595172014-05-12 13:56:20 -07002694 * StreamConfigurationMap#getOutputStallDuration(int,Size).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002695 * <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
2696 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
2697 * <p><b>Units</b>: Nanoseconds</p>
2698 * <p><b>Range of valid values:</b><br>
2699 * See {@link CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION android.sensor.info.maxFrameDuration},
2700 * {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}. The duration
2701 * is capped to <code>max(duration, exposureTime + overhead)</code>.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002702 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2703 * <p><b>Full capability</b> -
2704 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2705 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002706 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002707 * @see CaptureRequest#CONTROL_AE_MODE
2708 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002709 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Igor Murashkin9c595172014-05-12 13:56:20 -07002710 * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002711 * @see CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002712 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002713 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002714 public static final Key<Long> SENSOR_FRAME_DURATION =
2715 new Key<Long>("android.sensor.frameDuration", long.class);
2716
2717 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002718 * <p>The amount of gain applied to sensor data
2719 * before processing.</p>
2720 * <p>The sensitivity is the standard ISO sensitivity value,
2721 * as defined in ISO 12232:2006.</p>
2722 * <p>The sensitivity must be within {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}, and
2723 * if if it less than {@link CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY android.sensor.maxAnalogSensitivity}, the camera device
2724 * is guaranteed to use only analog amplification for applying the gain.</p>
2725 * <p>If the camera device cannot apply the exact sensitivity
2726 * requested, it will reduce the gain to the nearest supported
2727 * value. The final sensitivity used will be available in the
2728 * output capture result.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002729 * <p><b>Units</b>: ISO arithmetic units</p>
2730 * <p><b>Range of valid values:</b><br>
2731 * {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002732 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2733 * <p><b>Full capability</b> -
2734 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2735 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002736 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002737 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002738 * @see CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE
2739 * @see CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002740 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002741 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002742 public static final Key<Integer> SENSOR_SENSITIVITY =
2743 new Key<Integer>("android.sensor.sensitivity", int.class);
2744
2745 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002746 * <p>Time at start of exposure of first
Zhijun He0bda31a2014-06-13 14:38:39 -07002747 * row of the image sensor active array, in nanoseconds.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002748 * <p>The timestamps are also included in all image
2749 * buffers produced for the same capture, and will be identical
Zhijun He45fa43a12014-06-13 18:29:37 -07002750 * on all the outputs.</p>
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07002751 * <p>When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> UNKNOWN,
Zhijun He45fa43a12014-06-13 18:29:37 -07002752 * the timestamps measure time since an unspecified starting point,
2753 * and are monotonically increasing. They can be compared with the
2754 * timestamps for other captures from the same camera device, but are
2755 * not guaranteed to be comparable to any other time source.</p>
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07002756 * <p>When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> REALTIME,
Zhijun He45fa43a12014-06-13 18:29:37 -07002757 * the timestamps measure time in the same timebase as
2758 * android.os.SystemClock#elapsedRealtimeNanos(), and they can be
2759 * compared to other timestamps from other subsystems that are using
2760 * that base.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002761 * <p><b>Units</b>: Nanoseconds</p>
2762 * <p><b>Range of valid values:</b><br>
2763 * &gt; 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002764 * <p>This key is available on all devices.</p>
Zhijun He45fa43a12014-06-13 18:29:37 -07002765 *
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07002766 * @see CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002767 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002768 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002769 public static final Key<Long> SENSOR_TIMESTAMP =
2770 new Key<Long>("android.sensor.timestamp", long.class);
2771
2772 /**
Ruben Brunk7c062362014-04-15 23:53:53 -07002773 * <p>The estimated camera neutral color in the native sensor colorspace at
2774 * the time of capture.</p>
2775 * <p>This value gives the neutral color point encoded as an RGB value in the
2776 * native sensor color space. The neutral color point indicates the
2777 * currently estimated white point of the scene illumination. It can be
2778 * used to interpolate between the provided color transforms when
2779 * processing raw sensor data.</p>
2780 * <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 -08002781 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2782 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002783 @PublicKey
Ruben Brunk20c76f62014-02-07 15:47:10 -08002784 public static final Key<Rational[]> SENSOR_NEUTRAL_COLOR_POINT =
2785 new Key<Rational[]>("android.sensor.neutralColorPoint", Rational[].class);
2786
2787 /**
Ruben Brunk1b1f1b62014-07-23 17:49:08 -07002788 * <p>Noise model coefficients for each CFA mosaic channel.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002789 * <p>This key contains two noise model coefficients for each CFA channel
Ruben Brunk1b1f1b62014-07-23 17:49:08 -07002790 * corresponding to the sensor amplification (S) and sensor readout
2791 * noise (O). These are given as pairs of coefficients for each channel
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002792 * in the same order as channels listed for the CFA layout key
Ruben Brunk1b1f1b62014-07-23 17:49:08 -07002793 * (see {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT android.sensor.info.colorFilterArrangement}). This is
2794 * represented as an array of Pair&lt;Double, Double&gt;, where
2795 * the first member of the Pair at index n is the S coefficient and the
2796 * second member is the O coefficient for the nth color channel in the CFA.</p>
2797 * <p>These coefficients are used in a two parameter noise model to describe
2798 * the amount of noise present in the image for each CFA channel. The
2799 * noise model used here is:</p>
2800 * <p>N(x) = sqrt(Sx + O)</p>
2801 * <p>Where x represents the recorded signal of a CFA channel normalized to
2802 * the range [0, 1], and S and O are the noise model coeffiecients for
2803 * that channel.</p>
2804 * <p>A more detailed description of the noise model can be found in the
2805 * Adobe DNG specification for the NoiseProfile tag.</p>
2806 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2807 *
2808 * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
2809 */
2810 @PublicKey
2811 public static final Key<android.util.Pair<Double,Double>[]> SENSOR_NOISE_PROFILE =
2812 new Key<android.util.Pair<Double,Double>[]>("android.sensor.noiseProfile", new TypeReference<android.util.Pair<Double,Double>[]>() {{ }});
2813
2814 /**
Ruben Brunk987d9f72014-02-11 18:00:24 -08002815 * <p>The worst-case divergence between Bayer green channels.</p>
2816 * <p>This value is an estimate of the worst case split between the
2817 * Bayer green channels in the red and blue rows in the sensor color
2818 * filter array.</p>
2819 * <p>The green split is calculated as follows:</p>
2820 * <ol>
Ruben Brunke89b1202014-03-24 17:10:35 -07002821 * <li>A 5x5 pixel (or larger) window W within the active sensor array is
2822 * chosen. The term 'pixel' here is taken to mean a group of 4 Bayer
2823 * mosaic channels (R, Gr, Gb, B). The location and size of the window
2824 * chosen is implementation defined, and should be chosen to provide a
2825 * green split estimate that is both representative of the entire image
2826 * for this camera sensor, and can be calculated quickly.</li>
Ruben Brunk987d9f72014-02-11 18:00:24 -08002827 * <li>The arithmetic mean of the green channels from the red
2828 * rows (mean_Gr) within W is computed.</li>
2829 * <li>The arithmetic mean of the green channels from the blue
2830 * rows (mean_Gb) within W is computed.</li>
2831 * <li>The maximum ratio R of the two means is computed as follows:
2832 * <code>R = max((mean_Gr + 1)/(mean_Gb + 1), (mean_Gb + 1)/(mean_Gr + 1))</code></li>
2833 * </ol>
2834 * <p>The ratio R is the green split divergence reported for this property,
2835 * which represents how much the green channels differ in the mosaic
2836 * pattern. This value is typically used to determine the treatment of
2837 * the green mosaic channels when demosaicing.</p>
2838 * <p>The green split value can be roughly interpreted as follows:</p>
2839 * <ul>
2840 * <li>R &lt; 1.03 is a negligible split (&lt;3% divergence).</li>
2841 * <li>1.20 &lt;= R &gt;= 1.03 will require some software
2842 * correction to avoid demosaic errors (3-20% divergence).</li>
2843 * <li>R &gt; 1.20 will require strong software correction to produce
2844 * a usuable image (&gt;20% divergence).</li>
2845 * </ul>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002846 * <p><b>Range of valid values:</b><br></p>
2847 * <p>&gt;= 0</p>
Ruben Brunk987d9f72014-02-11 18:00:24 -08002848 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2849 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002850 @PublicKey
Ruben Brunk987d9f72014-02-11 18:00:24 -08002851 public static final Key<Float> SENSOR_GREEN_SPLIT =
2852 new Key<Float>("android.sensor.greenSplit", float.class);
2853
2854 /**
Zhijun He379af012014-05-06 11:54:54 -07002855 * <p>A pixel <code>[R, G_even, G_odd, B]</code> that supplies the test pattern
2856 * when {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode} is SOLID_COLOR.</p>
2857 * <p>Each color channel is treated as an unsigned 32-bit integer.
2858 * The camera device then uses the most significant X bits
2859 * that correspond to how many bits are in its Bayer raw sensor
2860 * output.</p>
2861 * <p>For example, a sensor with RAW10 Bayer output would use the
2862 * 10 most significant bits from each color channel.</p>
2863 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2864 *
2865 * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
2866 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002867 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07002868 public static final Key<int[]> SENSOR_TEST_PATTERN_DATA =
2869 new Key<int[]>("android.sensor.testPatternData", int[].class);
2870
2871 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08002872 * <p>When enabled, the sensor sends a test pattern instead of
2873 * doing a real exposure from the camera.</p>
2874 * <p>When a test pattern is enabled, all manual sensor controls specified
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002875 * by android.sensor.* will be ignored. All other controls should
Igor Murashkinc127f052014-01-17 18:06:02 -08002876 * work as normal.</p>
2877 * <p>For example, if manual flash is enabled, flash firing should still
2878 * occur (and that the test pattern remain unmodified, since the flash
2879 * would not actually affect it).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002880 * <p>Defaults to OFF.</p>
2881 * <p><b>Possible values:</b>
2882 * <ul>
2883 * <li>{@link #SENSOR_TEST_PATTERN_MODE_OFF OFF}</li>
2884 * <li>{@link #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR SOLID_COLOR}</li>
2885 * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS COLOR_BARS}</li>
2886 * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY COLOR_BARS_FADE_TO_GRAY}</li>
2887 * <li>{@link #SENSOR_TEST_PATTERN_MODE_PN9 PN9}</li>
2888 * <li>{@link #SENSOR_TEST_PATTERN_MODE_CUSTOM1 CUSTOM1}</li>
2889 * </ul></p>
2890 * <p><b>Available values for this device:</b><br>
2891 * {@link CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES android.sensor.availableTestPatternModes}</p>
Igor Murashkinc127f052014-01-17 18:06:02 -08002892 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002893 *
2894 * @see CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES
Igor Murashkinc127f052014-01-17 18:06:02 -08002895 * @see #SENSOR_TEST_PATTERN_MODE_OFF
2896 * @see #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR
2897 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS
2898 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY
2899 * @see #SENSOR_TEST_PATTERN_MODE_PN9
2900 * @see #SENSOR_TEST_PATTERN_MODE_CUSTOM1
2901 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002902 @PublicKey
Igor Murashkinc127f052014-01-17 18:06:02 -08002903 public static final Key<Integer> SENSOR_TEST_PATTERN_MODE =
2904 new Key<Integer>("android.sensor.testPatternMode", int.class);
2905
2906 /**
Zhijun He0bda31a2014-06-13 14:38:39 -07002907 * <p>Duration between the start of first row exposure
2908 * and the start of last row exposure.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002909 * <p>This is the exposure time skew between the first and last
2910 * row exposure start times. The first row and the last row are
2911 * the first and last rows inside of the
2912 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
Zhijun He0bda31a2014-06-13 14:38:39 -07002913 * <p>For typical camera sensors that use rolling shutters, this is also equivalent
2914 * to the frame readout time.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002915 * <p><b>Units</b>: Nanoseconds</p>
2916 * <p><b>Range of valid values:</b><br>
2917 * &gt;= 0 and &lt;
2918 * StreamConfigurationMap#getOutputMinFrameDuration(int, Size).</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002919 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2920 * <p><b>Limited capability</b> -
2921 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2922 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He0bda31a2014-06-13 14:38:39 -07002923 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002924 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He0bda31a2014-06-13 14:38:39 -07002925 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2926 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002927 @PublicKey
Zhijun He0bda31a2014-06-13 14:38:39 -07002928 public static final Key<Long> SENSOR_ROLLING_SHUTTER_SKEW =
2929 new Key<Long>("android.sensor.rollingShutterSkew", long.class);
2930
2931 /**
Zhijun Heba93fe62014-01-17 16:43:05 -08002932 * <p>Quality of lens shading correction applied
2933 * to the image data.</p>
2934 * <p>When set to OFF mode, no lens shading correction will be applied by the
2935 * camera device, and an identity lens shading map data will be provided
2936 * 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 -07002937 * shading map with size of <code>[ 4, 3 ]</code>,
2938 * the output {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap} for this case will be an identity
2939 * map shown below:</p>
Zhijun Heba93fe62014-01-17 16:43:05 -08002940 * <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 -07002941 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2942 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2943 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2944 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
2945 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ]
Zhijun Heba93fe62014-01-17 16:43:05 -08002946 * </code></pre>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002947 * <p>When set to other modes, lens shading correction will be applied by the camera
2948 * device. Applications can request lens shading map data by setting
2949 * {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} to ON, and then the camera device will provide lens
2950 * shading map data in {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap}; the returned shading map
2951 * data will be the one applied by the camera device for this capture request.</p>
2952 * <p>The shading map data may depend on the auto-exposure (AE) and AWB statistics, therefore
2953 * the reliability of the map data may be affected by the AE and AWB algorithms. When AE and
2954 * 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>
2955 * OFF), to get best results, it is recommended that the applications wait for the AE and AWB
2956 * to be converged before using the returned shading map data.</p>
2957 * <p><b>Possible values:</b>
2958 * <ul>
2959 * <li>{@link #SHADING_MODE_OFF OFF}</li>
2960 * <li>{@link #SHADING_MODE_FAST FAST}</li>
2961 * <li>{@link #SHADING_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
2962 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002963 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2964 * <p><b>Full capability</b> -
2965 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2966 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heba93fe62014-01-17 16:43:05 -08002967 *
Zhijun Hefa7c7552014-05-22 16:36:02 -07002968 * @see CaptureRequest#CONTROL_AE_MODE
2969 * @see CaptureRequest#CONTROL_AWB_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002970 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002971 * @see CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP
Zhijun Heba93fe62014-01-17 16:43:05 -08002972 * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
2973 * @see #SHADING_MODE_OFF
2974 * @see #SHADING_MODE_FAST
2975 * @see #SHADING_MODE_HIGH_QUALITY
Zhijun Heba93fe62014-01-17 16:43:05 -08002976 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002977 @PublicKey
Zhijun Heba93fe62014-01-17 16:43:05 -08002978 public static final Key<Integer> SHADING_MODE =
2979 new Key<Integer>("android.shading.mode", int.class);
2980
2981 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002982 * <p>Operating mode for the face detector
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002983 * unit.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002984 * <p>Whether face detection is enabled, and whether it
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002985 * should output just the basic fields or the full set of
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002986 * fields.</p>
2987 * <p><b>Possible values:</b>
2988 * <ul>
2989 * <li>{@link #STATISTICS_FACE_DETECT_MODE_OFF OFF}</li>
2990 * <li>{@link #STATISTICS_FACE_DETECT_MODE_SIMPLE SIMPLE}</li>
2991 * <li>{@link #STATISTICS_FACE_DETECT_MODE_FULL FULL}</li>
2992 * </ul></p>
2993 * <p><b>Available values for this device:</b><br>
2994 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}</p>
2995 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08002996 *
2997 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002998 * @see #STATISTICS_FACE_DETECT_MODE_OFF
2999 * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE
3000 * @see #STATISTICS_FACE_DETECT_MODE_FULL
3001 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003002 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003003 public static final Key<Integer> STATISTICS_FACE_DETECT_MODE =
3004 new Key<Integer>("android.statistics.faceDetectMode", int.class);
3005
3006 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003007 * <p>List of unique IDs for detected faces.</p>
3008 * <p>Each detected face is given a unique ID that is valid for as long as the face is visible
3009 * to the camera device. A face that leaves the field of view and later returns may be
3010 * assigned a new ID.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003011 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL
3012 * This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003013 *
3014 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003015 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003016 */
3017 public static final Key<int[]> STATISTICS_FACE_IDS =
3018 new Key<int[]>("android.statistics.faceIds", int[].class);
3019
3020 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003021 * <p>List of landmarks for detected
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003022 * faces.</p>
3023 * <p>The coordinate system is that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
3024 * <code>(0, 0)</code> being the top-left pixel of the active array.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003025 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL
3026 * This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003027 *
3028 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3029 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003030 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003031 */
3032 public static final Key<int[]> STATISTICS_FACE_LANDMARKS =
3033 new Key<int[]>("android.statistics.faceLandmarks", int[].class);
3034
3035 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003036 * <p>List of the bounding rectangles for detected
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003037 * faces.</p>
3038 * <p>The coordinate system is that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
3039 * <code>(0, 0)</code> being the top-left pixel of the active array.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003040 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} != OFF
3041 * This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003042 *
3043 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3044 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003045 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003046 */
3047 public static final Key<android.graphics.Rect[]> STATISTICS_FACE_RECTANGLES =
3048 new Key<android.graphics.Rect[]>("android.statistics.faceRectangles", android.graphics.Rect[].class);
3049
3050 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003051 * <p>List of the face confidence scores for
3052 * detected faces</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003053 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} != OFF.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003054 * <p><b>Range of valid values:</b><br>
3055 * 1-100</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003056 * <p>This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003057 *
3058 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003059 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003060 */
3061 public static final Key<byte[]> STATISTICS_FACE_SCORES =
3062 new Key<byte[]>("android.statistics.faceScores", byte[].class);
3063
3064 /**
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003065 * <p>List of the faces detected through camera face detection
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003066 * in this capture.</p>
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003067 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} <code>!=</code> OFF.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003068 * <p>This key is available on all devices.</p>
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003069 *
3070 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
3071 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003072 @PublicKey
3073 @SyntheticKey
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003074 public static final Key<android.hardware.camera2.params.Face[]> STATISTICS_FACES =
3075 new Key<android.hardware.camera2.params.Face[]>("android.statistics.faces", android.hardware.camera2.params.Face[].class);
3076
3077 /**
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003078 * <p>The shading map is a low-resolution floating-point map
3079 * that lists the coefficients used to correct for vignetting, for each
3080 * Bayer color channel.</p>
3081 * <p>The least shaded section of the image should have a gain factor
3082 * of 1; all other sections should have gains above 1.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003083 * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map
Igor Murashkinace5bf02013-12-10 17:36:40 -08003084 * must take into account the colorCorrection settings.</p>
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003085 * <p>The shading map is for the entire active pixel array, and is not
3086 * affected by the crop region specified in the request. Each shading map
3087 * entry is the value of the shading compensation map over a specific
3088 * pixel on the sensor. Specifically, with a (N x M) resolution shading
3089 * map, and an active pixel array size (W x H), shading map entry
3090 * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at
3091 * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
3092 * The map is assumed to be bilinearly interpolated between the sample points.</p>
3093 * <p>The channel order is [R, Geven, Godd, B], where Geven is the green
3094 * channel for the even rows of a Bayer pattern, and Godd is the odd rows.
Ruben Brunk57493682014-05-27 18:58:08 -07003095 * The shading map is stored in a fully interleaved format.</p>
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003096 * <p>The shading map should have on the order of 30-40 rows and columns,
3097 * and must be smaller than 64x64.</p>
3098 * <p>As an example, given a very small map defined as:</p>
Ruben Brunk57493682014-05-27 18:58:08 -07003099 * <pre><code>width,height = [ 4, 3 ]
3100 * values =
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003101 * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2,
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003102 * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3,
3103 * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0,
3104 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2,
3105 * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2,
3106 * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ]
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003107 * </code></pre>
3108 * <p>The low-resolution scaling map images for each channel are
3109 * (displayed using nearest-neighbor interpolation):</p>
3110 * <p><img alt="Red lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" />
3111 * <img alt="Green (even rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" />
3112 * <img alt="Green (odd rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" />
3113 * <img alt="Blue lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/blue_shading.png" /></p>
3114 * <p>As a visualization only, inverting the full-color map to recover an
3115 * image of a gray wall (using bicubic interpolation for visual quality) as captured by the sensor gives:</p>
3116 * <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 -07003117 * <p><b>Range of valid values:</b><br>
3118 * Each gain factor is &gt;= 1</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003119 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3120 * <p><b>Full capability</b> -
3121 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3122 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003123 *
Zhijun He5f2a47f2014-01-16 15:44:41 -08003124 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003125 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk57493682014-05-27 18:58:08 -07003126 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003127 @PublicKey
Ruben Brunk57493682014-05-27 18:58:08 -07003128 public static final Key<android.hardware.camera2.params.LensShadingMap> STATISTICS_LENS_SHADING_CORRECTION_MAP =
3129 new Key<android.hardware.camera2.params.LensShadingMap>("android.statistics.lensShadingCorrectionMap", android.hardware.camera2.params.LensShadingMap.class);
3130
3131 /**
3132 * <p>The shading map is a low-resolution floating-point map
3133 * that lists the coefficients used to correct for vignetting, for each
3134 * Bayer color channel.</p>
3135 * <p>The least shaded section of the image should have a gain factor
3136 * of 1; all other sections should have gains above 1.</p>
3137 * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map
3138 * must take into account the colorCorrection settings.</p>
3139 * <p>The shading map is for the entire active pixel array, and is not
3140 * affected by the crop region specified in the request. Each shading map
3141 * entry is the value of the shading compensation map over a specific
3142 * pixel on the sensor. Specifically, with a (N x M) resolution shading
3143 * map, and an active pixel array size (W x H), shading map entry
3144 * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at
3145 * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
3146 * The map is assumed to be bilinearly interpolated between the sample points.</p>
3147 * <p>The channel order is [R, Geven, Godd, B], where Geven is the green
3148 * channel for the even rows of a Bayer pattern, and Godd is the odd rows.
3149 * The shading map is stored in a fully interleaved format, and its size
3150 * is provided in the camera static metadata by android.lens.info.shadingMapSize.</p>
3151 * <p>The shading map should have on the order of 30-40 rows and columns,
3152 * and must be smaller than 64x64.</p>
3153 * <p>As an example, given a very small map defined as:</p>
3154 * <pre><code>android.lens.info.shadingMapSize = [ 4, 3 ]
3155 * android.statistics.lensShadingMap =
3156 * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2,
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003157 * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3,
3158 * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0,
3159 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2,
3160 * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2,
3161 * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ]
Ruben Brunk57493682014-05-27 18:58:08 -07003162 * </code></pre>
3163 * <p>The low-resolution scaling map images for each channel are
3164 * (displayed using nearest-neighbor interpolation):</p>
3165 * <p><img alt="Red lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" />
3166 * <img alt="Green (even rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" />
3167 * <img alt="Green (odd rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" />
3168 * <img alt="Blue lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/blue_shading.png" /></p>
3169 * <p>As a visualization only, inverting the full-color map to recover an
3170 * image of a gray wall (using bicubic interpolation for visual quality) as captured by the sensor gives:</p>
3171 * <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 -07003172 * <p><b>Range of valid values:</b><br>
3173 * Each gain factor is &gt;= 1</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003174 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3175 * <p><b>Full capability</b> -
3176 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3177 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk57493682014-05-27 18:58:08 -07003178 *
3179 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003180 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk57493682014-05-27 18:58:08 -07003181 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003182 */
3183 public static final Key<float[]> STATISTICS_LENS_SHADING_MAP =
3184 new Key<float[]>("android.statistics.lensShadingMap", float[].class);
3185
3186 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003187 * <p>The best-fit color channel gains calculated
Zhijun Hecc28a412014-02-24 15:11:23 -08003188 * by the camera device's statistics units for the current output frame.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08003189 * <p>This may be different than the gains used for this frame,
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003190 * since statistics processing on data from a new frame
3191 * typically completes after the transform has already been
Igor Murashkinace5bf02013-12-10 17:36:40 -08003192 * applied to that frame.</p>
3193 * <p>The 4 channel gains are defined in Bayer domain,
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003194 * see {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} for details.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003195 * <p>This value should always be calculated by the auto-white balance (AWB) block,
Igor Murashkinace5bf02013-12-10 17:36:40 -08003196 * regardless of the android.control.* current values.</p>
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08003197 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003198 *
3199 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Igor Murashkin9c595172014-05-12 13:56:20 -07003200 * @deprecated
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08003201 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003202 */
Igor Murashkin9c595172014-05-12 13:56:20 -07003203 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003204 public static final Key<float[]> STATISTICS_PREDICTED_COLOR_GAINS =
3205 new Key<float[]>("android.statistics.predictedColorGains", float[].class);
3206
3207 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003208 * <p>The best-fit color transform matrix estimate
Zhijun Hecc28a412014-02-24 15:11:23 -08003209 * calculated by the camera device's statistics units for the current
3210 * output frame.</p>
3211 * <p>The camera device will provide the estimate from its
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003212 * statistics unit on the white balance transforms to use
Zhijun Hecc28a412014-02-24 15:11:23 -08003213 * for the next frame. These are the values the camera device believes
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003214 * are the best fit for the current output frame. This may
3215 * be different than the transform used for this frame, since
3216 * statistics processing on data from a new frame typically
3217 * completes after the transform has already been applied to
Igor Murashkinace5bf02013-12-10 17:36:40 -08003218 * that frame.</p>
3219 * <p>These estimates must be provided for all frames, even if
3220 * capture settings and color transforms are set by the application.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003221 * <p>This value should always be calculated by the auto-white balance (AWB) block,
Igor Murashkinace5bf02013-12-10 17:36:40 -08003222 * regardless of the android.control.* current values.</p>
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08003223 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07003224 * @deprecated
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08003225 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003226 */
Igor Murashkin9c595172014-05-12 13:56:20 -07003227 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003228 public static final Key<Rational[]> STATISTICS_PREDICTED_COLOR_TRANSFORM =
3229 new Key<Rational[]>("android.statistics.predictedColorTransform", Rational[].class);
3230
3231 /**
Zhijun He208fb6c2014-02-03 13:09:06 -08003232 * <p>The camera device estimated scene illumination lighting
3233 * frequency.</p>
3234 * <p>Many light sources, such as most fluorescent lights, flicker at a rate
3235 * that depends on the local utility power standards. This flicker must be
3236 * accounted for by auto-exposure routines to avoid artifacts in captured images.
3237 * The camera device uses this entry to tell the application what the scene
3238 * illuminant frequency is.</p>
3239 * <p>When manual exposure control is enabled
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003240 * (<code>{@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} == OFF</code> or <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} ==
3241 * OFF</code>), the {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} doesn't perform
3242 * antibanding, and the application can ensure it selects
3243 * exposure times that do not cause banding issues by looking
3244 * into this metadata field. See
3245 * {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} for more details.</p>
3246 * <p>Reports NONE if there doesn't appear to be flickering illumination.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003247 * <p><b>Possible values:</b>
3248 * <ul>
3249 * <li>{@link #STATISTICS_SCENE_FLICKER_NONE NONE}</li>
3250 * <li>{@link #STATISTICS_SCENE_FLICKER_50HZ 50HZ}</li>
3251 * <li>{@link #STATISTICS_SCENE_FLICKER_60HZ 60HZ}</li>
3252 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003253 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3254 * <p><b>Full capability</b> -
3255 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3256 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He208fb6c2014-02-03 13:09:06 -08003257 *
3258 * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
3259 * @see CaptureRequest#CONTROL_AE_MODE
3260 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003261 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003262 * @see #STATISTICS_SCENE_FLICKER_NONE
3263 * @see #STATISTICS_SCENE_FLICKER_50HZ
3264 * @see #STATISTICS_SCENE_FLICKER_60HZ
3265 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003266 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003267 public static final Key<Integer> STATISTICS_SCENE_FLICKER =
3268 new Key<Integer>("android.statistics.sceneFlicker", int.class);
3269
3270 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003271 * <p>Operating mode for hot pixel map generation.</p>
3272 * <p>If set to <code>true</code>, a hot pixel map is returned in {@link CaptureResult#STATISTICS_HOT_PIXEL_MAP android.statistics.hotPixelMap}.
3273 * If set to <code>false</code>, no hot pixel map will be returned.</p>
3274 * <p><b>Range of valid values:</b><br>
3275 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES android.statistics.info.availableHotPixelMapModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003276 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08003277 *
3278 * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP
3279 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES
3280 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003281 @PublicKey
Ruben Brunk9d454fd2014-03-04 14:11:52 -08003282 public static final Key<Boolean> STATISTICS_HOT_PIXEL_MAP_MODE =
3283 new Key<Boolean>("android.statistics.hotPixelMapMode", boolean.class);
3284
3285 /**
3286 * <p>List of <code>(x, y)</code> coordinates of hot/defective pixels on the sensor.</p>
3287 * <p>A coordinate <code>(x, y)</code> must lie between <code>(0, 0)</code>, and
3288 * <code>(width - 1, height - 1)</code> (inclusive), which are the top-left and
3289 * bottom-right of the pixel array, respectively. The width and
3290 * height dimensions are given in {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.
3291 * This may include hot pixels that lie outside of the active array
3292 * bounds given by {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003293 * <p><b>Range of valid values:</b><br></p>
3294 * <p>n &lt;= number of pixels on the sensor.
3295 * The <code>(x, y)</code> coordinates must be bounded by
3296 * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003297 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08003298 *
3299 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3300 * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
3301 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003302 @PublicKey
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003303 public static final Key<android.graphics.Point[]> STATISTICS_HOT_PIXEL_MAP =
3304 new Key<android.graphics.Point[]>("android.statistics.hotPixelMap", android.graphics.Point[].class);
Ruben Brunk9d454fd2014-03-04 14:11:52 -08003305
3306 /**
Zhijun He379af012014-05-06 11:54:54 -07003307 * <p>Whether the camera device will output the lens
3308 * shading map in output result metadata.</p>
3309 * <p>When set to ON,
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003310 * android.statistics.lensShadingMap will be provided in
Zhijun He379af012014-05-06 11:54:54 -07003311 * the output result metadata.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003312 * <p>ON is always supported on devices with the RAW capability.</p>
3313 * <p><b>Possible values:</b>
3314 * <ul>
3315 * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_OFF OFF}</li>
3316 * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_ON ON}</li>
3317 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003318 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3319 * <p><b>Full capability</b> -
3320 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3321 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3322 *
3323 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He379af012014-05-06 11:54:54 -07003324 * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF
3325 * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON
3326 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003327 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07003328 public static final Key<Integer> STATISTICS_LENS_SHADING_MAP_MODE =
3329 new Key<Integer>("android.statistics.lensShadingMapMode", int.class);
3330
3331 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003332 * <p>Tonemapping / contrast / gamma curve for the blue
Igor Murashkine0060932014-01-17 17:24:11 -08003333 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
3334 * CONTRAST_CURVE.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003335 * <p>See android.tonemap.curveRed for more details.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003336 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3337 * <p><b>Full capability</b> -
3338 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3339 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003340 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003341 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He5f2a47f2014-01-16 15:44:41 -08003342 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003343 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003344 */
Zhijun He3ffd7052013-08-19 15:45:08 -07003345 public static final Key<float[]> TONEMAP_CURVE_BLUE =
3346 new Key<float[]>("android.tonemap.curveBlue", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003347
3348 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003349 * <p>Tonemapping / contrast / gamma curve for the green
Igor Murashkine0060932014-01-17 17:24:11 -08003350 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
3351 * CONTRAST_CURVE.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003352 * <p>See android.tonemap.curveRed for more details.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003353 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3354 * <p><b>Full capability</b> -
3355 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3356 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003357 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003358 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He5f2a47f2014-01-16 15:44:41 -08003359 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003360 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003361 */
Zhijun He3ffd7052013-08-19 15:45:08 -07003362 public static final Key<float[]> TONEMAP_CURVE_GREEN =
3363 new Key<float[]>("android.tonemap.curveGreen", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003364
3365 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003366 * <p>Tonemapping / contrast / gamma curve for the red
Igor Murashkine0060932014-01-17 17:24:11 -08003367 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
3368 * CONTRAST_CURVE.</p>
3369 * <p>Each channel's curve is defined by an array of control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003370 * <pre><code>android.tonemap.curveRed =
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003371 * [ P0in, P0out, P1in, P1out, P2in, P2out, P3in, P3out, ..., PNin, PNout ]
Zhijun He870922b2014-02-15 21:47:51 -08003372 * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003373 * <p>These are sorted in order of increasing <code>Pin</code>; it is
3374 * required that input values 0.0 and 1.0 are included in the list to
Igor Murashkine0060932014-01-17 17:24:11 -08003375 * define a complete mapping. For input values between control points,
3376 * the camera device must linearly interpolate between the control
3377 * points.</p>
3378 * <p>Each curve can have an independent number of points, and the number
3379 * of points can be less than max (that is, the request doesn't have to
3380 * always provide a curve with number of points equivalent to
3381 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
3382 * <p>A few examples, and their corresponding graphical mappings; these
3383 * only specify the red channel and the precision is limited to 4
3384 * digits, for conciseness.</p>
3385 * <p>Linear mapping:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003386 * <pre><code>android.tonemap.curveRed = [ 0, 0, 1.0, 1.0 ]
Igor Murashkine0060932014-01-17 17:24:11 -08003387 * </code></pre>
3388 * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p>
3389 * <p>Invert mapping:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003390 * <pre><code>android.tonemap.curveRed = [ 0, 1.0, 1.0, 0 ]
Igor Murashkine0060932014-01-17 17:24:11 -08003391 * </code></pre>
3392 * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p>
3393 * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003394 * <pre><code>android.tonemap.curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003395 * 0.0000, 0.0000, 0.0667, 0.2920, 0.1333, 0.4002, 0.2000, 0.4812,
3396 * 0.2667, 0.5484, 0.3333, 0.6069, 0.4000, 0.6594, 0.4667, 0.7072,
3397 * 0.5333, 0.7515, 0.6000, 0.7928, 0.6667, 0.8317, 0.7333, 0.8685,
3398 * 0.8000, 0.9035, 0.8667, 0.9370, 0.9333, 0.9691, 1.0000, 1.0000 ]
Igor Murashkine0060932014-01-17 17:24:11 -08003399 * </code></pre>
3400 * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p>
3401 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003402 * <pre><code>android.tonemap.curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003403 * 0.0000, 0.0000, 0.0667, 0.2864, 0.1333, 0.4007, 0.2000, 0.4845,
3404 * 0.2667, 0.5532, 0.3333, 0.6125, 0.4000, 0.6652, 0.4667, 0.7130,
3405 * 0.5333, 0.7569, 0.6000, 0.7977, 0.6667, 0.8360, 0.7333, 0.8721,
3406 * 0.8000, 0.9063, 0.8667, 0.9389, 0.9333, 0.9701, 1.0000, 1.0000 ]
Igor Murashkine0060932014-01-17 17:24:11 -08003407 * </code></pre>
3408 * <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 -07003409 * <p><b>Range of valid values:</b><br>
3410 * 0-1 on both input and output coordinates, normalized
3411 * as a floating-point value such that 0 == black and 1 == white.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003412 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3413 * <p><b>Full capability</b> -
3414 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3415 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003416 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003417 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Igor Murashkine0060932014-01-17 17:24:11 -08003418 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003419 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003420 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003421 */
3422 public static final Key<float[]> TONEMAP_CURVE_RED =
3423 new Key<float[]>("android.tonemap.curveRed", float[].class);
3424
3425 /**
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003426 * <p>Tonemapping / contrast / gamma curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode}
3427 * is CONTRAST_CURVE.</p>
3428 * <p>The tonemapCurve consist of three curves for each of red, green, and blue
3429 * channels respectively. The following example uses the red channel as an
3430 * example. The same logic applies to green and blue channel.
3431 * Each channel's curve is defined by an array of control points:</p>
3432 * <pre><code>curveRed =
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003433 * [ P0(in, out), P1(in, out), P2(in, out), P3(in, out), ..., PN(in, out) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003434 * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
3435 * <p>These are sorted in order of increasing <code>Pin</code>; it is always
3436 * guaranteed that input values 0.0 and 1.0 are included in the list to
3437 * define a complete mapping. For input values between control points,
3438 * the camera device must linearly interpolate between the control
3439 * points.</p>
3440 * <p>Each curve can have an independent number of points, and the number
3441 * of points can be less than max (that is, the request doesn't have to
3442 * always provide a curve with number of points equivalent to
3443 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
3444 * <p>A few examples, and their corresponding graphical mappings; these
3445 * only specify the red channel and the precision is limited to 4
3446 * digits, for conciseness.</p>
3447 * <p>Linear mapping:</p>
3448 * <pre><code>curveRed = [ (0, 0), (1.0, 1.0) ]
3449 * </code></pre>
3450 * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p>
3451 * <p>Invert mapping:</p>
3452 * <pre><code>curveRed = [ (0, 1.0), (1.0, 0) ]
3453 * </code></pre>
3454 * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p>
3455 * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
3456 * <pre><code>curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003457 * (0.0000, 0.0000), (0.0667, 0.2920), (0.1333, 0.4002), (0.2000, 0.4812),
3458 * (0.2667, 0.5484), (0.3333, 0.6069), (0.4000, 0.6594), (0.4667, 0.7072),
3459 * (0.5333, 0.7515), (0.6000, 0.7928), (0.6667, 0.8317), (0.7333, 0.8685),
3460 * (0.8000, 0.9035), (0.8667, 0.9370), (0.9333, 0.9691), (1.0000, 1.0000) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003461 * </code></pre>
3462 * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p>
3463 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
3464 * <pre><code>curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003465 * (0.0000, 0.0000), (0.0667, 0.2864), (0.1333, 0.4007), (0.2000, 0.4845),
3466 * (0.2667, 0.5532), (0.3333, 0.6125), (0.4000, 0.6652), (0.4667, 0.7130),
3467 * (0.5333, 0.7569), (0.6000, 0.7977), (0.6667, 0.8360), (0.7333, 0.8721),
3468 * (0.8000, 0.9063), (0.8667, 0.9389), (0.9333, 0.9701), (1.0000, 1.0000) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003469 * </code></pre>
3470 * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003471 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3472 * <p><b>Full capability</b> -
3473 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3474 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003475 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003476 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003477 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
3478 * @see CaptureRequest#TONEMAP_MODE
3479 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003480 @PublicKey
3481 @SyntheticKey
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003482 public static final Key<android.hardware.camera2.params.TonemapCurve> TONEMAP_CURVE =
3483 new Key<android.hardware.camera2.params.TonemapCurve>("android.tonemap.curve", android.hardware.camera2.params.TonemapCurve.class);
3484
3485 /**
Igor Murashkine0060932014-01-17 17:24:11 -08003486 * <p>High-level global contrast/gamma/tonemapping control.</p>
3487 * <p>When switching to an application-defined contrast curve by setting
3488 * {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} to CONTRAST_CURVE, the curve is defined
3489 * per-channel with a set of <code>(in, out)</code> points that specify the
3490 * mapping from input high-bit-depth pixel value to the output
3491 * low-bit-depth value. Since the actual pixel ranges of both input
3492 * and output may change depending on the camera pipeline, the values
3493 * are specified by normalized floating-point numbers.</p>
3494 * <p>More-complex color mapping operations such as 3D color look-up
3495 * tables, selective chroma enhancement, or other non-linear color
3496 * transforms will be disabled when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
3497 * CONTRAST_CURVE.</p>
3498 * <p>When using either FAST or HIGH_QUALITY, the camera device will
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003499 * emit its own tonemap curve in {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}.
Igor Murashkine0060932014-01-17 17:24:11 -08003500 * These values are always available, and as close as possible to the
3501 * actually used nonlinear/nonglobal transforms.</p>
Zhijun Hefa7c7552014-05-22 16:36:02 -07003502 * <p>If a request is sent with CONTRAST_CURVE with the camera device's
Igor Murashkine0060932014-01-17 17:24:11 -08003503 * provided curve in FAST or HIGH_QUALITY, the image's tonemap will be
3504 * roughly the same.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003505 * <p><b>Possible values:</b>
3506 * <ul>
3507 * <li>{@link #TONEMAP_MODE_CONTRAST_CURVE CONTRAST_CURVE}</li>
3508 * <li>{@link #TONEMAP_MODE_FAST FAST}</li>
3509 * <li>{@link #TONEMAP_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
3510 * </ul></p>
3511 * <p><b>Available values for this device:</b><br>
3512 * {@link CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES android.tonemap.availableToneMapModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003513 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3514 * <p><b>Full capability</b> -
3515 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3516 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08003517 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003518 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -08003519 * @see CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003520 * @see CaptureRequest#TONEMAP_CURVE
Igor Murashkine0060932014-01-17 17:24:11 -08003521 * @see CaptureRequest#TONEMAP_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003522 * @see #TONEMAP_MODE_CONTRAST_CURVE
3523 * @see #TONEMAP_MODE_FAST
3524 * @see #TONEMAP_MODE_HIGH_QUALITY
3525 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003526 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003527 public static final Key<Integer> TONEMAP_MODE =
3528 new Key<Integer>("android.tonemap.mode", int.class);
3529
3530 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003531 * <p>This LED is nominally used to indicate to the user
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003532 * that the camera is powered on and may be streaming images back to the
3533 * Application Processor. In certain rare circumstances, the OS may
3534 * disable this when video is processed locally and not transmitted to
Igor Murashkinace5bf02013-12-10 17:36:40 -08003535 * any untrusted applications.</p>
3536 * <p>In particular, the LED <em>must</em> always be on when the data could be
3537 * transmitted off the device. The LED <em>should</em> always be on whenever
3538 * data is stored locally on the device.</p>
3539 * <p>The LED <em>may</em> be off if a trusted application is using the data that
3540 * doesn't violate the above rules.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003541 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003542 * @hide
3543 */
3544 public static final Key<Boolean> LED_TRANSMIT =
3545 new Key<Boolean>("android.led.transmit", boolean.class);
3546
3547 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003548 * <p>Whether black-level compensation is locked
Eino-Ville Talvala0956af52013-12-26 13:19:10 -08003549 * to its current values, or is free to vary.</p>
3550 * <p>Whether the black level offset was locked for this frame. Should be
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003551 * 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 -08003552 * a change in other capture settings forced the camera device to
3553 * perform a black level reset.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003554 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3555 * <p><b>Full capability</b> -
3556 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3557 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003558 *
3559 * @see CaptureRequest#BLACK_LEVEL_LOCK
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003560 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003561 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003562 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003563 public static final Key<Boolean> BLACK_LEVEL_LOCK =
3564 new Key<Boolean>("android.blackLevel.lock", boolean.class);
3565
Igor Murashkin3865a842014-01-17 18:18:39 -08003566 /**
3567 * <p>The frame number corresponding to the last request
3568 * with which the output result (metadata + buffers) has been fully
3569 * synchronized.</p>
3570 * <p>When a request is submitted to the camera device, there is usually a
3571 * delay of several frames before the controls get applied. A camera
3572 * device may either choose to account for this delay by implementing a
3573 * pipeline and carefully submit well-timed atomic control updates, or
3574 * it may start streaming control changes that span over several frame
3575 * boundaries.</p>
3576 * <p>In the latter case, whenever a request's settings change relative to
3577 * the previous submitted request, the full set of changes may take
3578 * multiple frame durations to fully take effect. Some settings may
3579 * take effect sooner (in less frame durations) than others.</p>
3580 * <p>While a set of control changes are being propagated, this value
3581 * will be CONVERGING.</p>
3582 * <p>Once it is fully known that a set of control changes have been
3583 * finished propagating, and the resulting updated control settings
3584 * have been read back by the camera device, this value will be set
3585 * to a non-negative frame number (corresponding to the request to
3586 * which the results have synchronized to).</p>
3587 * <p>Older camera device implementations may not have a way to detect
3588 * when all camera controls have been applied, and will always set this
3589 * value to UNKNOWN.</p>
3590 * <p>FULL capability devices will always have this value set to the
3591 * frame number of the request corresponding to this result.</p>
3592 * <p><em>Further details</em>:</p>
3593 * <ul>
3594 * <li>Whenever a request differs from the last request, any future
3595 * results not yet returned may have this value set to CONVERGING (this
3596 * could include any in-progress captures not yet returned by the camera
3597 * device, for more details see pipeline considerations below).</li>
3598 * <li>Submitting a series of multiple requests that differ from the
3599 * previous request (e.g. r1, r2, r3 s.t. r1 != r2 != r3)
3600 * moves the new synchronization frame to the last non-repeating
3601 * request (using the smallest frame number from the contiguous list of
3602 * repeating requests).</li>
3603 * <li>Submitting the same request repeatedly will not change this value
3604 * to CONVERGING, if it was already a non-negative value.</li>
3605 * <li>When this value changes to non-negative, that means that all of the
3606 * metadata controls from the request have been applied, all of the
3607 * metadata controls from the camera device have been read to the
3608 * updated values (into the result), and all of the graphics buffers
3609 * corresponding to this result are also synchronized to the request.</li>
3610 * </ul>
3611 * <p><em>Pipeline considerations</em>:</p>
3612 * <p>Submitting a request with updated controls relative to the previously
3613 * submitted requests may also invalidate the synchronization state
3614 * of all the results corresponding to currently in-flight requests.</p>
3615 * <p>In other words, results for this current request and up to
3616 * {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} prior requests may have their
3617 * android.sync.frameNumber change to CONVERGING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003618 * <p><b>Possible values:</b>
3619 * <ul>
3620 * <li>{@link #SYNC_FRAME_NUMBER_CONVERGING CONVERGING}</li>
3621 * <li>{@link #SYNC_FRAME_NUMBER_UNKNOWN UNKNOWN}</li>
3622 * </ul></p>
3623 * <p><b>Available values for this device:</b><br>
3624 * Either a non-negative value corresponding to a
3625 * <code>frame_number</code>, or one of the two enums (CONVERGING / UNKNOWN).</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003626 * <p>This key is available on all devices.</p>
Igor Murashkin3865a842014-01-17 18:18:39 -08003627 *
3628 * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
3629 * @see #SYNC_FRAME_NUMBER_CONVERGING
3630 * @see #SYNC_FRAME_NUMBER_UNKNOWN
3631 * @hide
3632 */
Zhijun He4f91e2a2014-04-17 13:20:21 -07003633 public static final Key<Long> SYNC_FRAME_NUMBER =
3634 new Key<Long>("android.sync.frameNumber", long.class);
Igor Murashkin3865a842014-01-17 18:18:39 -08003635
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003636 /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
3637 * End generated code
3638 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
Igor Murashkin6c76f582014-07-15 17:19:49 -07003639
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003640
3641
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08003642}