blob: 479583cf38967f93603f9e1cbdfd8c34bad75ecb [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 Talvala8b905572015-05-14 15:43:01 -070019import android.annotation.NonNull;
20import android.annotation.Nullable;
Eino-Ville Talvala70c22072013-08-27 12:09:04 -070021import android.hardware.camera2.impl.CameraMetadataNative;
Igor Murashkinbdf366c2014-07-25 16:54:20 -070022import android.hardware.camera2.impl.CaptureResultExtras;
Igor Murashkin6c76f582014-07-15 17:19:49 -070023import android.hardware.camera2.impl.PublicKey;
24import android.hardware.camera2.impl.SyntheticKey;
Igor Murashkind6d65152014-05-19 16:31:02 -070025import android.hardware.camera2.utils.TypeReference;
26import android.util.Log;
Igor Murashkin72f9f0a2014-05-14 15:46:10 -070027import android.util.Rational;
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080028
Igor Murashkind6d65152014-05-19 16:31:02 -070029import java.util.List;
30
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080031/**
Igor Murashkindb075af2014-05-21 10:07:08 -070032 * <p>The subset of the results of a single image capture from the image sensor.</p>
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080033 *
Igor Murashkindb075af2014-05-21 10:07:08 -070034 * <p>Contains a subset of the final configuration for the capture hardware (sensor, lens,
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080035 * flash), the processing pipeline, the control algorithms, and the output
36 * buffers.</p>
37 *
38 * <p>CaptureResults are produced by a {@link CameraDevice} after processing a
39 * {@link CaptureRequest}. All properties listed for capture requests can also
40 * be queried on the capture result, to determine the final values used for
41 * capture. The result also includes additional metadata about the state of the
42 * camera device during the capture.</p>
43 *
Igor Murashkindb075af2014-05-21 10:07:08 -070044 * <p>Not all properties returned by {@link CameraCharacteristics#getAvailableCaptureResultKeys()}
45 * are necessarily available. Some results are {@link CaptureResult partial} and will
46 * not have every key set. Only {@link TotalCaptureResult total} results are guaranteed to have
47 * every key available that was enabled by the request.</p>
48 *
49 * <p>{@link CaptureResult} objects are immutable.</p>
Ruben Brunkf967a542014-04-28 16:31:11 -070050 *
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080051 */
Igor Murashkindb075af2014-05-21 10:07:08 -070052public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> {
Igor Murashkind6d65152014-05-19 16:31:02 -070053
54 private static final String TAG = "CaptureResult";
55 private static final boolean VERBOSE = false;
56
57 /**
58 * A {@code Key} is used to do capture result field lookups with
59 * {@link CaptureResult#get}.
60 *
61 * <p>For example, to get the timestamp corresponding to the exposure of the first row:
62 * <code><pre>
63 * long timestamp = captureResult.get(CaptureResult.SENSOR_TIMESTAMP);
64 * </pre></code>
65 * </p>
66 *
67 * <p>To enumerate over all possible keys for {@link CaptureResult}, see
68 * {@link CameraCharacteristics#getAvailableCaptureResultKeys}.</p>
69 *
70 * @see CaptureResult#get
71 * @see CameraCharacteristics#getAvailableCaptureResultKeys
72 */
73 public final static class Key<T> {
74 private final CameraMetadataNative.Key<T> mKey;
75
76 /**
77 * Visible for testing and vendor extensions only.
78 *
79 * @hide
80 */
81 public Key(String name, Class<T> type) {
82 mKey = new CameraMetadataNative.Key<T>(name, type);
83 }
84
85 /**
86 * Visible for testing and vendor extensions only.
87 *
88 * @hide
89 */
90 public Key(String name, TypeReference<T> typeReference) {
91 mKey = new CameraMetadataNative.Key<T>(name, typeReference);
92 }
93
94 /**
95 * Return a camelCase, period separated name formatted like:
96 * {@code "root.section[.subsections].name"}.
97 *
98 * <p>Built-in keys exposed by the Android SDK are always prefixed with {@code "android."};
99 * keys that are device/platform-specific are prefixed with {@code "com."}.</p>
100 *
101 * <p>For example, {@code CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP} would
102 * have a name of {@code "android.scaler.streamConfigurationMap"}; whereas a device
103 * specific key might look like {@code "com.google.nexus.data.private"}.</p>
104 *
105 * @return String representation of the key name
106 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700107 @NonNull
Igor Murashkind6d65152014-05-19 16:31:02 -0700108 public String getName() {
109 return mKey.getName();
110 }
111
112 /**
113 * {@inheritDoc}
114 */
115 @Override
116 public final int hashCode() {
117 return mKey.hashCode();
118 }
119
120 /**
121 * {@inheritDoc}
122 */
123 @SuppressWarnings("unchecked")
124 @Override
125 public final boolean equals(Object o) {
126 return o instanceof Key && ((Key<T>)o).mKey.equals(mKey);
127 }
128
129 /**
130 * Visible for CameraMetadataNative implementation only; do not use.
131 *
132 * TODO: Make this private or remove it altogether.
133 *
134 * @hide
135 */
136 public CameraMetadataNative.Key<T> getNativeKey() {
137 return mKey;
138 }
139
140 @SuppressWarnings({ "unchecked" })
141 /*package*/ Key(CameraMetadataNative.Key<?> nativeKey) {
142 mKey = (CameraMetadataNative.Key<T>) nativeKey;
143 }
144 }
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700145
146 private final CameraMetadataNative mResults;
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700147 private final CaptureRequest mRequest;
148 private final int mSequenceId;
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700149 private final long mFrameNumber;
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700150
Igor Murashkin70725502013-06-25 20:27:06 +0000151 /**
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700152 * Takes ownership of the passed-in properties object
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700153 *
154 * <p>For internal use only</p>
Igor Murashkin70725502013-06-25 20:27:06 +0000155 * @hide
156 */
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700157 public CaptureResult(CameraMetadataNative results, CaptureRequest parent,
158 CaptureResultExtras extras) {
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700159 if (results == null) {
160 throw new IllegalArgumentException("results was null");
161 }
162
163 if (parent == null) {
164 throw new IllegalArgumentException("parent was null");
165 }
166
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700167 if (extras == null) {
168 throw new IllegalArgumentException("extras was null");
169 }
170
Igor Murashkind6d65152014-05-19 16:31:02 -0700171 mResults = CameraMetadataNative.move(results);
172 if (mResults.isEmpty()) {
173 throw new AssertionError("Results must not be empty");
174 }
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700175 mRequest = parent;
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700176 mSequenceId = extras.getRequestId();
177 mFrameNumber = extras.getFrameNumber();
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700178 }
179
Ruben Brunkf967a542014-04-28 16:31:11 -0700180 /**
181 * Returns a copy of the underlying {@link CameraMetadataNative}.
182 * @hide
183 */
184 public CameraMetadataNative getNativeCopy() {
185 return new CameraMetadataNative(mResults);
186 }
187
Igor Murashkind6d65152014-05-19 16:31:02 -0700188 /**
189 * Creates a request-less result.
190 *
191 * <p><strong>For testing only.</strong></p>
192 * @hide
193 */
194 public CaptureResult(CameraMetadataNative results, int sequenceId) {
195 if (results == null) {
196 throw new IllegalArgumentException("results was null");
197 }
198
199 mResults = CameraMetadataNative.move(results);
200 if (mResults.isEmpty()) {
201 throw new AssertionError("Results must not be empty");
202 }
203
204 mRequest = null;
205 mSequenceId = sequenceId;
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700206 mFrameNumber = -1;
Igor Murashkind6d65152014-05-19 16:31:02 -0700207 }
208
209 /**
210 * Get a capture result field value.
211 *
212 * <p>The field definitions can be found in {@link CaptureResult}.</p>
213 *
214 * <p>Querying the value for the same key more than once will return a value
215 * which is equal to the previous queried value.</p>
216 *
217 * @throws IllegalArgumentException if the key was not valid
218 *
219 * @param key The result field to read.
220 * @return The value of that key, or {@code null} if the field is not set.
221 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700222 @Nullable
Eino-Ville Talvala70c22072013-08-27 12:09:04 -0700223 public <T> T get(Key<T> key) {
Igor Murashkind6d65152014-05-19 16:31:02 -0700224 T value = mResults.get(key);
225 if (VERBOSE) Log.v(TAG, "#get for Key = " + key.getName() + ", returned value = " + value);
226 return value;
227 }
228
229 /**
230 * {@inheritDoc}
231 * @hide
232 */
233 @SuppressWarnings("unchecked")
234 @Override
235 protected <T> T getProtected(Key<?> key) {
236 return (T) mResults.get(key);
237 }
238
239 /**
240 * {@inheritDoc}
241 * @hide
242 */
243 @SuppressWarnings("unchecked")
244 @Override
245 protected Class<Key<?>> getKeyClass() {
246 Object thisClass = Key.class;
247 return (Class<Key<?>>)thisClass;
248 }
249
250 /**
251 * Dumps the native metadata contents to logcat.
252 *
253 * <p>Visibility for testing/debugging only. The results will not
254 * include any synthesized keys, as they are invisible to the native layer.</p>
255 *
256 * @hide
257 */
258 public void dumpToLog() {
259 mResults.dumpToLog();
260 }
261
262 /**
263 * {@inheritDoc}
264 */
265 @Override
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700266 @NonNull
Igor Murashkind6d65152014-05-19 16:31:02 -0700267 public List<Key<?>> getKeys() {
268 // Force the javadoc for this function to show up on the CaptureResult page
269 return super.getKeys();
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800270 }
271
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700272 /**
273 * Get the request associated with this result.
274 *
Igor Murashkindb075af2014-05-21 10:07:08 -0700275 * <p>Whenever a request has been fully or partially captured, with
Eino-Ville Talvalafd887432014-09-04 13:07:40 -0700276 * {@link CameraCaptureSession.CaptureCallback#onCaptureCompleted} or
277 * {@link CameraCaptureSession.CaptureCallback#onCaptureProgressed}, the {@code result}'s
Igor Murashkindb075af2014-05-21 10:07:08 -0700278 * {@code getRequest()} will return that {@code request}.
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700279 * </p>
280 *
Igor Murashkindb075af2014-05-21 10:07:08 -0700281 * <p>For example,
Eino-Ville Talvalafd887432014-09-04 13:07:40 -0700282 * <code><pre>cameraDevice.capture(someRequest, new CaptureCallback() {
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700283 * {@literal @}Override
284 * void onCaptureCompleted(CaptureRequest myRequest, CaptureResult myResult) {
285 * assert(myResult.getRequest.equals(myRequest) == true);
286 * }
Igor Murashkindb075af2014-05-21 10:07:08 -0700287 * }, null);
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700288 * </code></pre>
289 * </p>
290 *
291 * @return The request associated with this result. Never {@code null}.
292 */
Eino-Ville Talvala8b905572015-05-14 15:43:01 -0700293 @NonNull
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700294 public CaptureRequest getRequest() {
295 return mRequest;
296 }
297
298 /**
299 * Get the frame number associated with this result.
300 *
301 * <p>Whenever a request has been processed, regardless of failure or success,
302 * it gets a unique frame number assigned to its future result/failure.</p>
303 *
Chien-Yu Chen5398a672015-03-19 14:48:43 -0700304 * <p>For the same type of request (capturing from the camera device or reprocessing), this
305 * value monotonically increments, starting with 0, for every new result or failure and the
306 * scope is the lifetime of the {@link CameraDevice}. Between different types of requests,
307 * the frame number may not monotonically increment. For example, the frame number of a newer
308 * reprocess result may be smaller than the frame number of an older result of capturing new
309 * images from the camera device, but the frame number of a newer reprocess result will never be
310 * smaller than the frame number of an older reprocess result.</p>
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700311 *
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700312 * @return The frame number
Chien-Yu Chen5398a672015-03-19 14:48:43 -0700313 *
314 * @see CameraDevice#createCaptureRequest
315 * @see CameraDevice#createReprocessCaptureRequest
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700316 */
Igor Murashkinbdf366c2014-07-25 16:54:20 -0700317 public long getFrameNumber() {
318 return mFrameNumber;
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700319 }
320
321 /**
322 * The sequence ID for this failure that was returned by the
Eino-Ville Talvala0a160ac2014-07-02 14:29:26 -0700323 * {@link CameraCaptureSession#capture} family of functions.
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700324 *
325 * <p>The sequence ID is a unique monotonically increasing value starting from 0,
326 * incremented every time a new group of requests is submitted to the CameraDevice.</p>
327 *
328 * @return int The ID for the sequence of requests that this capture result is a part of
329 *
Eino-Ville Talvalafd887432014-09-04 13:07:40 -0700330 * @see CameraDevice.CaptureCallback#onCaptureSequenceCompleted
331 * @see CameraDevice.CaptureCallback#onCaptureSequenceAborted
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700332 */
333 public int getSequenceId() {
334 return mSequenceId;
335 }
336
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700337 /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
338 * The key entries below this point are generated from metadata
339 * definitions in /system/media/camera/docs. Do not modify by hand or
340 * modify the comment blocks at the start or end.
341 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/
342
343 /**
Zhijun He379af012014-05-06 11:54:54 -0700344 * <p>The mode control selects how the image data is converted from the
345 * sensor's native color into linear sRGB color.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700346 * <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 -0700347 * control is overridden by the AWB routine. When AWB is disabled, the
348 * application controls how the color mapping is performed.</p>
349 * <p>We define the expected processing pipeline below. For consistency
350 * across devices, this is always the case with TRANSFORM_MATRIX.</p>
351 * <p>When either FULL or HIGH_QUALITY is used, the camera device may
352 * do additional processing but {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
353 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} will still be provided by the
354 * camera device (in the results) and be roughly correct.</p>
355 * <p>Switching to TRANSFORM_MATRIX and using the data provided from
356 * FAST or HIGH_QUALITY will yield a picture with the same white point
357 * as what was produced by the camera device in the earlier frame.</p>
358 * <p>The expected processing pipeline is as follows:</p>
359 * <p><img alt="White balance processing pipeline" src="../../../../images/camera2/metadata/android.colorCorrection.mode/processing_pipeline.png" /></p>
360 * <p>The white balance is encoded by two values, a 4-channel white-balance
361 * gain vector (applied in the Bayer domain), and a 3x3 color transform
362 * matrix (applied after demosaic).</p>
363 * <p>The 4-channel white-balance gains are defined as:</p>
364 * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} = [ R G_even G_odd B ]
365 * </code></pre>
366 * <p>where <code>G_even</code> is the gain for green pixels on even rows of the
367 * output, and <code>G_odd</code> is the gain for green pixels on the odd rows.
368 * These may be identical for a given camera device implementation; if
369 * the camera device does not support a separate gain for even/odd green
370 * channels, it will use the <code>G_even</code> value, and write <code>G_odd</code> equal to
371 * <code>G_even</code> in the output result metadata.</p>
372 * <p>The matrices for color transforms are defined as a 9-entry vector:</p>
373 * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} = [ I0 I1 I2 I3 I4 I5 I6 I7 I8 ]
374 * </code></pre>
375 * <p>which define a transform from input sensor colors, <code>P_in = [ r g b ]</code>,
376 * to output linear sRGB, <code>P_out = [ r' g' b' ]</code>,</p>
377 * <p>with colors as follows:</p>
378 * <pre><code>r' = I0r + I1g + I2b
379 * g' = I3r + I4g + I5b
380 * b' = I6r + I7g + I8b
381 * </code></pre>
382 * <p>Both the input and output value ranges must match. Overflow/underflow
383 * values are clipped to fit within the range.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700384 * <p><b>Possible values:</b>
385 * <ul>
386 * <li>{@link #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX TRANSFORM_MATRIX}</li>
387 * <li>{@link #COLOR_CORRECTION_MODE_FAST FAST}</li>
388 * <li>{@link #COLOR_CORRECTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
389 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700390 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
391 * <p><b>Full capability</b> -
392 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
393 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He379af012014-05-06 11:54:54 -0700394 *
395 * @see CaptureRequest#COLOR_CORRECTION_GAINS
396 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
397 * @see CaptureRequest#CONTROL_AWB_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700398 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He379af012014-05-06 11:54:54 -0700399 * @see #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX
400 * @see #COLOR_CORRECTION_MODE_FAST
401 * @see #COLOR_CORRECTION_MODE_HIGH_QUALITY
402 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700403 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700404 public static final Key<Integer> COLOR_CORRECTION_MODE =
405 new Key<Integer>("android.colorCorrection.mode", int.class);
406
407 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800408 * <p>A color transform matrix to use to transform
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700409 * from sensor RGB color space to output linear sRGB color space.</p>
Zhijun He49a3ca92014-02-05 13:48:09 -0800410 * <p>This matrix is either set by the camera device when the request
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800411 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700412 * directly by the application in the request when the
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800413 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p>
Zhijun He49a3ca92014-02-05 13:48:09 -0800414 * <p>In the latter case, the camera device may round the matrix to account
415 * for precision issues; the final rounded matrix should be reported back
416 * in this matrix result metadata. The transform should keep the magnitude
417 * of the output color values within <code>[0, 1.0]</code> (assuming input color
418 * values is within the normalized range <code>[0, 1.0]</code>), or clipping may occur.</p>
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -0800419 * <p>The valid range of each matrix element varies on different devices, but
420 * values within [-1.5, 3.0] are guaranteed not to be clipped.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700421 * <p><b>Units</b>: Unitless scale factors</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700422 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
423 * <p><b>Full capability</b> -
424 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
425 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800426 *
427 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700428 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700429 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700430 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700431 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> COLOR_CORRECTION_TRANSFORM =
432 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.colorCorrection.transform", android.hardware.camera2.params.ColorSpaceTransform.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700433
434 /**
Igor Murashkin7d2a5c52014-01-17 15:07:52 -0800435 * <p>Gains applying to Bayer raw color channels for
Zhijun Hecc28a412014-02-24 15:11:23 -0800436 * white-balance.</p>
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700437 * <p>These per-channel gains are either set by the camera device
438 * when the request {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not
439 * TRANSFORM_MATRIX, or directly by the application in the
440 * request when the {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is
441 * TRANSFORM_MATRIX.</p>
442 * <p>The gains in the result metadata are the gains actually
443 * applied by the camera device to the current frame.</p>
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -0800444 * <p>The valid range of gains varies on different devices, but gains
445 * between [1.0, 3.0] are guaranteed not to be clipped. Even if a given
446 * device allows gains below 1.0, this is usually not recommended because
447 * this can create color artifacts.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700448 * <p><b>Units</b>: Unitless gain factors</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700449 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
450 * <p><b>Full capability</b> -
451 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
452 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800453 *
454 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700455 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700456 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700457 @PublicKey
Eino-Ville Talvala2bb91a72014-05-27 18:16:53 -0700458 public static final Key<android.hardware.camera2.params.RggbChannelVector> COLOR_CORRECTION_GAINS =
459 new Key<android.hardware.camera2.params.RggbChannelVector>("android.colorCorrection.gains", android.hardware.camera2.params.RggbChannelVector.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700460
461 /**
Zhijun Hea05e59d2014-07-08 18:27:47 -0700462 * <p>Mode of operation for the chromatic aberration correction algorithm.</p>
Zhijun Hea05e59d2014-07-08 18:27:47 -0700463 * <p>Chromatic (color) aberration is caused by the fact that different wavelengths of light
464 * can not focus on the same point after exiting from the lens. This metadata defines
465 * the high level control of chromatic aberration correction algorithm, which aims to
466 * minimize the chromatic artifacts that may occur along the object boundaries in an
467 * image.</p>
468 * <p>FAST/HIGH_QUALITY both mean that camera device determined aberration
469 * correction will be applied. HIGH_QUALITY mode indicates that the camera device will
470 * use the highest-quality aberration correction algorithms, even if it slows down
471 * capture rate. FAST means the camera device will not slow down capture rate when
472 * applying aberration correction.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700473 * <p>LEGACY devices will always be in FAST mode.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700474 * <p><b>Possible values:</b>
475 * <ul>
476 * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_OFF OFF}</li>
477 * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_FAST FAST}</li>
478 * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
479 * </ul></p>
480 * <p><b>Available values for this device:</b><br>
481 * {@link CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES android.colorCorrection.availableAberrationModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700482 * <p>This key is available on all devices.</p>
Zhijun Hea05e59d2014-07-08 18:27:47 -0700483 *
Zhijun He9e4e4392014-08-18 11:12:32 -0700484 * @see CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES
485 * @see #COLOR_CORRECTION_ABERRATION_MODE_OFF
486 * @see #COLOR_CORRECTION_ABERRATION_MODE_FAST
487 * @see #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY
Zhijun Hea05e59d2014-07-08 18:27:47 -0700488 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700489 @PublicKey
Zhijun He9e4e4392014-08-18 11:12:32 -0700490 public static final Key<Integer> COLOR_CORRECTION_ABERRATION_MODE =
491 new Key<Integer>("android.colorCorrection.aberrationMode", int.class);
Zhijun Hea05e59d2014-07-08 18:27:47 -0700492
493 /**
Zhijun He379af012014-05-06 11:54:54 -0700494 * <p>The desired setting for the camera device's auto-exposure
495 * algorithm's antibanding compensation.</p>
496 * <p>Some kinds of lighting fixtures, such as some fluorescent
497 * lights, flicker at the rate of the power supply frequency
498 * (60Hz or 50Hz, depending on country). While this is
499 * typically not noticeable to a person, it can be visible to
500 * a camera device. If a camera sets its exposure time to the
501 * wrong value, the flicker may become visible in the
502 * viewfinder as flicker or in a final captured image, as a
503 * set of variable-brightness bands across the image.</p>
504 * <p>Therefore, the auto-exposure routines of camera devices
505 * include antibanding routines that ensure that the chosen
506 * exposure value will not cause such banding. The choice of
507 * exposure time depends on the rate of flicker, which the
508 * camera device can detect automatically, or the expected
509 * rate can be selected by the application using this
510 * control.</p>
511 * <p>A given camera device may not support all of the possible
512 * options for the antibanding mode. The
513 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes} key contains
514 * the available modes for a given camera device.</p>
Yin-Chia Yeh7b2cae62014-11-25 11:54:18 -0800515 * <p>AUTO mode is the default if it is available on given
516 * camera device. When AUTO mode is not available, the
517 * default will be either 50HZ or 60HZ, and both 50HZ
518 * and 60HZ will be available.</p>
Zhijun He379af012014-05-06 11:54:54 -0700519 * <p>If manual exposure control is enabled (by setting
520 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} to OFF),
521 * then this setting has no effect, and the application must
522 * ensure it selects exposure times that do not cause banding
523 * issues. The {@link CaptureResult#STATISTICS_SCENE_FLICKER android.statistics.sceneFlicker} key can assist
524 * the application in this.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700525 * <p><b>Possible values:</b>
526 * <ul>
527 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_OFF OFF}</li>
528 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_50HZ 50HZ}</li>
529 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_60HZ 60HZ}</li>
530 * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_AUTO AUTO}</li>
531 * </ul></p>
532 * <p><b>Available values for this device:</b><br></p>
533 * <p>{@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700534 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -0700535 *
536 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES
537 * @see CaptureRequest#CONTROL_AE_MODE
538 * @see CaptureRequest#CONTROL_MODE
539 * @see CaptureResult#STATISTICS_SCENE_FLICKER
540 * @see #CONTROL_AE_ANTIBANDING_MODE_OFF
541 * @see #CONTROL_AE_ANTIBANDING_MODE_50HZ
542 * @see #CONTROL_AE_ANTIBANDING_MODE_60HZ
543 * @see #CONTROL_AE_ANTIBANDING_MODE_AUTO
544 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700545 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700546 public static final Key<Integer> CONTROL_AE_ANTIBANDING_MODE =
547 new Key<Integer>("android.control.aeAntibandingMode", int.class);
548
549 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700550 * <p>Adjustment to auto-exposure (AE) target image
551 * brightness.</p>
552 * <p>The adjustment is measured as a count of steps, with the
553 * step size defined by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep} and the
554 * allowed range by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}.</p>
555 * <p>For example, if the exposure value (EV) step is 0.333, '6'
556 * will mean an exposure compensation of +2 EV; -3 will mean an
557 * exposure compensation of -1 EV. One EV represents a doubling
558 * of image brightness. Note that this control will only be
559 * effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF. This control
560 * 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 -0700561 * <p>In the event of exposure compensation value being changed, camera device
562 * may take several frames to reach the newly requested exposure target.
563 * During that time, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} field will be in the SEARCHING
564 * state. Once the new exposure target is reached, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} will
565 * change from SEARCHING to either CONVERGED, LOCKED (if AE lock is enabled), or
566 * FLASH_REQUIRED (if the scene is too dark for still capture).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700567 * <p><b>Units</b>: Compensation steps</p>
568 * <p><b>Range of valid values:</b><br>
569 * {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700570 * <p>This key is available on all devices.</p>
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700571 *
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700572 * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE
573 * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700574 * @see CaptureRequest#CONTROL_AE_LOCK
575 * @see CaptureRequest#CONTROL_AE_MODE
576 * @see CaptureResult#CONTROL_AE_STATE
Zhijun He379af012014-05-06 11:54:54 -0700577 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700578 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700579 public static final Key<Integer> CONTROL_AE_EXPOSURE_COMPENSATION =
580 new Key<Integer>("android.control.aeExposureCompensation", int.class);
581
582 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700583 * <p>Whether auto-exposure (AE) is currently locked to its latest
Zhijun He379af012014-05-06 11:54:54 -0700584 * calculated values.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700585 * <p>When set to <code>true</code> (ON), the AE algorithm is locked to its latest parameters,
586 * and will not change exposure settings until the lock is set to <code>false</code> (OFF).</p>
587 * <p>Note that even when AE is locked, the flash may be fired if
588 * the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_AUTO_FLASH /
589 * ON_ALWAYS_FLASH / ON_AUTO_FLASH_REDEYE.</p>
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700590 * <p>When {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation} is changed, even if the AE lock
591 * is ON, the camera device will still adjust its exposure value.</p>
Zhijun He379af012014-05-06 11:54:54 -0700592 * <p>If AE precapture is triggered (see {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger})
593 * when AE is already locked, the camera device will not change the exposure time
594 * ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}) and sensitivity ({@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity})
595 * parameters. The flash may be fired if the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}
596 * is ON_AUTO_FLASH/ON_AUTO_FLASH_REDEYE and the scene is too dark. If the
Zhijun Hefa95b042015-02-09 10:40:49 -0800597 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_ALWAYS_FLASH, the scene may become overexposed.
598 * Similarly, AE precapture trigger CANCEL has no effect when AE is already locked.</p>
599 * <p>When an AE precapture sequence is triggered, AE unlock will not be able to unlock
600 * the AE if AE is locked by the camera device internally during precapture metering
601 * sequence In other words, submitting requests with AE unlock has no effect for an
602 * ongoing precapture metering sequence. Otherwise, the precapture metering sequence
603 * will never succeed in a sequence of preview requests where AE lock is always set
604 * to <code>false</code>.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700605 * <p>Since the camera device has a pipeline of in-flight requests, the settings that
606 * get locked do not necessarily correspond to the settings that were present in the
607 * latest capture result received from the camera device, since additional captures
608 * and AE updates may have occurred even before the result was sent out. If an
609 * application is switching between automatic and manual control and wishes to eliminate
610 * any flicker during the switch, the following procedure is recommended:</p>
611 * <ol>
612 * <li>Starting in auto-AE mode:</li>
613 * <li>Lock AE</li>
614 * <li>Wait for the first result to be output that has the AE locked</li>
615 * <li>Copy exposure settings from that result into a request, set the request to manual AE</li>
616 * <li>Submit the capture request, proceed to run manual AE as desired.</li>
617 * </ol>
Zhijun He379af012014-05-06 11:54:54 -0700618 * <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 -0700619 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -0700620 *
Yin-Chia Yeha4227df2014-05-05 14:27:39 -0700621 * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
Zhijun He379af012014-05-06 11:54:54 -0700622 * @see CaptureRequest#CONTROL_AE_MODE
623 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
624 * @see CaptureResult#CONTROL_AE_STATE
625 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
626 * @see CaptureRequest#SENSOR_SENSITIVITY
627 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700628 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700629 public static final Key<Boolean> CONTROL_AE_LOCK =
630 new Key<Boolean>("android.control.aeLock", boolean.class);
631
632 /**
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800633 * <p>The desired mode for the camera device's
634 * auto-exposure routine.</p>
635 * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is
636 * AUTO.</p>
637 * <p>When set to any of the ON modes, the camera device's
638 * auto-exposure routine is enabled, overriding the
639 * application's selected exposure time, sensor sensitivity,
640 * and frame duration ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
641 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and
642 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}). If one of the FLASH modes
643 * is selected, the camera device's flash unit controls are
644 * also overridden.</p>
645 * <p>The FLASH modes are only available if the camera device
646 * has a flash unit ({@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} is <code>true</code>).</p>
647 * <p>If flash TORCH mode is desired, this field must be set to
648 * ON or OFF, and {@link CaptureRequest#FLASH_MODE android.flash.mode} set to TORCH.</p>
649 * <p>When set to any of the ON modes, the values chosen by the
650 * camera device auto-exposure routine for the overridden
651 * fields for a given capture will be available in its
652 * CaptureResult.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700653 * <p><b>Possible values:</b>
654 * <ul>
655 * <li>{@link #CONTROL_AE_MODE_OFF OFF}</li>
656 * <li>{@link #CONTROL_AE_MODE_ON ON}</li>
657 * <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH ON_AUTO_FLASH}</li>
658 * <li>{@link #CONTROL_AE_MODE_ON_ALWAYS_FLASH ON_ALWAYS_FLASH}</li>
659 * <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE ON_AUTO_FLASH_REDEYE}</li>
660 * </ul></p>
661 * <p><b>Available values for this device:</b><br>
662 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES android.control.aeAvailableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700663 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800664 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700665 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES
Zhijun He5f2a47f2014-01-16 15:44:41 -0800666 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800667 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
668 * @see CaptureRequest#FLASH_MODE
Igor Murashkinaef3b7e2014-01-15 13:20:37 -0800669 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
670 * @see CaptureRequest#SENSOR_FRAME_DURATION
Zhijun He399f05d2014-01-15 11:31:30 -0800671 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800672 * @see #CONTROL_AE_MODE_OFF
673 * @see #CONTROL_AE_MODE_ON
674 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH
675 * @see #CONTROL_AE_MODE_ON_ALWAYS_FLASH
676 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE
677 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700678 @PublicKey
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800679 public static final Key<Integer> CONTROL_AE_MODE =
680 new Key<Integer>("android.control.aeMode", int.class);
681
682 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700683 * <p>List of metering areas to use for auto-exposure adjustment.</p>
684 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe} is 0.
Yin-Chia Yeh808150f2014-09-08 15:48:47 -0700685 * Otherwise will always be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700686 * <p>The maximum number of regions supported by the device is determined by the value
687 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe}.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -0800688 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -0700689 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800690 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
691 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -0700692 * bottom-right pixel in the active pixel array.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700693 * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -0700694 * for every pixel in the area. This means that a large metering area
695 * with the same weight as a smaller area will have more effect in
696 * the metering result. Metering areas can partially overlap and the
697 * camera device will add the weights in the overlap region.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700698 * <p>The weights are relative to weights of other exposure metering regions, so if only one
699 * region is used, all non-zero weights will have the same effect. A region with 0
700 * weight is ignored.</p>
701 * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
702 * camera device.</p>
703 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
704 * capture result metadata, the camera device will ignore the sections outside the crop
705 * region and output only the intersection rectangle as the metering region in the result
706 * metadata. If the region is entirely outside the crop region, it will be ignored and
707 * not reported in the result metadata.</p>
708 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
709 * <p><b>Range of valid values:</b><br>
710 * Coordinates must be between <code>[(0,0), (width, height))</code> of
711 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -0700712 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800713 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -0700714 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AE
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800715 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -0800716 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700717 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700718 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -0700719 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AE_REGIONS =
720 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.aeRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700721
722 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700723 * <p>Range over which the auto-exposure routine can
724 * adjust the capture frame rate to maintain good
725 * exposure.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700726 * <p>Only constrains auto-exposure (AE) algorithm, not
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700727 * manual control of {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime} and
728 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}.</p>
729 * <p><b>Units</b>: Frames per second (FPS)</p>
730 * <p><b>Range of valid values:</b><br>
731 * Any of the entries in {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES android.control.aeAvailableTargetFpsRanges}</p>
732 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -0700733 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700734 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES
Zhijun He379af012014-05-06 11:54:54 -0700735 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700736 * @see CaptureRequest#SENSOR_FRAME_DURATION
Zhijun He379af012014-05-06 11:54:54 -0700737 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700738 @PublicKey
Igor Murashkin78712a82014-05-27 18:32:18 -0700739 public static final Key<android.util.Range<Integer>> CONTROL_AE_TARGET_FPS_RANGE =
740 new Key<android.util.Range<Integer>>("android.control.aeTargetFpsRange", new TypeReference<android.util.Range<Integer>>() {{ }});
Zhijun He379af012014-05-06 11:54:54 -0700741
742 /**
743 * <p>Whether the camera device will trigger a precapture
744 * metering sequence when it processes this request.</p>
745 * <p>This entry is normally set to IDLE, or is not
746 * included at all in the request settings. When included and
Zhijun Hedd72be52015-02-06 13:49:51 -0800747 * set to START, the camera device will trigger the auto-exposure (AE)
Zhijun He379af012014-05-06 11:54:54 -0700748 * precapture metering sequence.</p>
Zhijun Hefa95b042015-02-09 10:40:49 -0800749 * <p>When set to CANCEL, the camera device will cancel any active
750 * precapture metering trigger, and return to its initial AE state.
751 * If a precapture metering sequence is already completed, and the camera
752 * device has implicitly locked the AE for subsequent still capture, the
753 * CANCEL trigger will unlock the AE and return to its initial AE state.</p>
Zhijun Hedd72be52015-02-06 13:49:51 -0800754 * <p>The precapture sequence should be triggered before starting a
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700755 * high-quality still capture for final metering decisions to
756 * be made, and for firing pre-capture flash pulses to estimate
757 * scene brightness and required final capture flash power, when
758 * the flash is enabled.</p>
759 * <p>Normally, this entry should be set to START for only a
760 * single request, and the application should wait until the
761 * sequence completes before starting a new one.</p>
Zhijun Hedd72be52015-02-06 13:49:51 -0800762 * <p>When a precapture metering sequence is finished, the camera device
763 * may lock the auto-exposure routine internally to be able to accurately expose the
764 * subsequent still capture image (<code>{@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} == STILL_CAPTURE</code>).
765 * For this case, the AE may not resume normal scan if no subsequent still capture is
766 * submitted. To ensure that the AE routine restarts normal scan, the application should
767 * submit a request with <code>{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} == true</code>, followed by a request
768 * with <code>{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} == false</code>, if the application decides not to submit a
Zhijun Hefa95b042015-02-09 10:40:49 -0800769 * still capture request after the precapture sequence completes. Alternatively, for
770 * API level 23 or newer devices, the CANCEL can be used to unlock the camera device
771 * internally locked AE if the application doesn't submit a still capture request after
772 * the AE precapture trigger. Note that, the CANCEL was added in API level 23, and must not
773 * be used in devices that have earlier API levels.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700774 * <p>The exact effect of auto-exposure (AE) precapture trigger
775 * depends on the current AE mode and state; see
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -0700776 * {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE precapture state transition
777 * details.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700778 * <p>On LEGACY-level devices, the precapture trigger is not supported;
779 * capturing a high-resolution JPEG image will automatically trigger a
780 * precapture sequence before the high-resolution capture, including
781 * potentially firing a pre-capture flash.</p>
782 * <p><b>Possible values:</b>
783 * <ul>
784 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE IDLE}</li>
785 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_START START}</li>
Zhijun Hefa95b042015-02-09 10:40:49 -0800786 * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL CANCEL}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -0700787 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700788 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
789 * <p><b>Limited capability</b> -
790 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
791 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He379af012014-05-06 11:54:54 -0700792 *
Zhijun Hedd72be52015-02-06 13:49:51 -0800793 * @see CaptureRequest#CONTROL_AE_LOCK
Zhijun He379af012014-05-06 11:54:54 -0700794 * @see CaptureResult#CONTROL_AE_STATE
Zhijun Hedd72be52015-02-06 13:49:51 -0800795 * @see CaptureRequest#CONTROL_CAPTURE_INTENT
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -0700796 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He379af012014-05-06 11:54:54 -0700797 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE
798 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_START
Zhijun Hefa95b042015-02-09 10:40:49 -0800799 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL
Zhijun He379af012014-05-06 11:54:54 -0700800 */
Igor Murashkin6c76f582014-07-15 17:19:49 -0700801 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -0700802 public static final Key<Integer> CONTROL_AE_PRECAPTURE_TRIGGER =
803 new Key<Integer>("android.control.aePrecaptureTrigger", int.class);
804
805 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -0700806 * <p>Current state of the auto-exposure (AE) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -0800807 * <p>Switching between or enabling AE modes ({@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}) always
808 * resets the AE state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
809 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
810 * the algorithm states to INACTIVE.</p>
811 * <p>The camera device can do several state transitions between two results, if it is
812 * allowed by the state transition table. For example: INACTIVE may never actually be
813 * seen in a result.</p>
814 * <p>The state in the result is the state for this image (in sync with this image): if
815 * AE state becomes CONVERGED, then the image data associated with this result should
816 * be good to use.</p>
817 * <p>Below are state transition tables for different AE modes.</p>
818 * <table>
819 * <thead>
820 * <tr>
821 * <th align="center">State</th>
822 * <th align="center">Transition Cause</th>
823 * <th align="center">New State</th>
824 * <th align="center">Notes</th>
825 * </tr>
826 * </thead>
827 * <tbody>
828 * <tr>
829 * <td align="center">INACTIVE</td>
830 * <td align="center"></td>
831 * <td align="center">INACTIVE</td>
832 * <td align="center">Camera device auto exposure algorithm is disabled</td>
833 * </tr>
834 * </tbody>
835 * </table>
836 * <p>When {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is AE_MODE_ON_*:</p>
837 * <table>
838 * <thead>
839 * <tr>
840 * <th align="center">State</th>
841 * <th align="center">Transition Cause</th>
842 * <th align="center">New State</th>
843 * <th align="center">Notes</th>
844 * </tr>
845 * </thead>
846 * <tbody>
847 * <tr>
848 * <td align="center">INACTIVE</td>
849 * <td align="center">Camera device initiates AE scan</td>
850 * <td align="center">SEARCHING</td>
851 * <td align="center">Values changing</td>
852 * </tr>
853 * <tr>
854 * <td align="center">INACTIVE</td>
855 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
856 * <td align="center">LOCKED</td>
857 * <td align="center">Values locked</td>
858 * </tr>
859 * <tr>
860 * <td align="center">SEARCHING</td>
861 * <td align="center">Camera device finishes AE scan</td>
862 * <td align="center">CONVERGED</td>
863 * <td align="center">Good values, not changing</td>
864 * </tr>
865 * <tr>
866 * <td align="center">SEARCHING</td>
867 * <td align="center">Camera device finishes AE scan</td>
868 * <td align="center">FLASH_REQUIRED</td>
869 * <td align="center">Converged but too dark w/o flash</td>
870 * </tr>
871 * <tr>
872 * <td align="center">SEARCHING</td>
873 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
874 * <td align="center">LOCKED</td>
875 * <td align="center">Values locked</td>
876 * </tr>
877 * <tr>
878 * <td align="center">CONVERGED</td>
879 * <td align="center">Camera device initiates AE scan</td>
880 * <td align="center">SEARCHING</td>
881 * <td align="center">Values changing</td>
882 * </tr>
883 * <tr>
884 * <td align="center">CONVERGED</td>
885 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
886 * <td align="center">LOCKED</td>
887 * <td align="center">Values locked</td>
888 * </tr>
889 * <tr>
890 * <td align="center">FLASH_REQUIRED</td>
891 * <td align="center">Camera device initiates AE scan</td>
892 * <td align="center">SEARCHING</td>
893 * <td align="center">Values changing</td>
894 * </tr>
895 * <tr>
896 * <td align="center">FLASH_REQUIRED</td>
897 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
898 * <td align="center">LOCKED</td>
899 * <td align="center">Values locked</td>
900 * </tr>
901 * <tr>
902 * <td align="center">LOCKED</td>
903 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
904 * <td align="center">SEARCHING</td>
905 * <td align="center">Values not good after unlock</td>
906 * </tr>
907 * <tr>
908 * <td align="center">LOCKED</td>
909 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
910 * <td align="center">CONVERGED</td>
911 * <td align="center">Values good after unlock</td>
912 * </tr>
913 * <tr>
914 * <td align="center">LOCKED</td>
915 * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
916 * <td align="center">FLASH_REQUIRED</td>
917 * <td align="center">Exposure good, but too dark</td>
918 * </tr>
919 * <tr>
920 * <td align="center">PRECAPTURE</td>
921 * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
922 * <td align="center">CONVERGED</td>
923 * <td align="center">Ready for high-quality capture</td>
924 * </tr>
925 * <tr>
926 * <td align="center">PRECAPTURE</td>
927 * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
928 * <td align="center">LOCKED</td>
929 * <td align="center">Ready for high-quality capture</td>
930 * </tr>
931 * <tr>
Zhijun Hefa95b042015-02-09 10:40:49 -0800932 * <td align="center">LOCKED</td>
933 * <td align="center">aeLock is ON and aePrecaptureTrigger is START</td>
934 * <td align="center">LOCKED</td>
935 * <td align="center">Precapture trigger is ignored when AE is already locked</td>
936 * </tr>
937 * <tr>
938 * <td align="center">LOCKED</td>
939 * <td align="center">aeLock is ON and aePrecaptureTrigger is CANCEL</td>
940 * <td align="center">LOCKED</td>
941 * <td align="center">Precapture trigger is ignored when AE is already locked</td>
942 * </tr>
943 * <tr>
944 * <td align="center">Any state (excluding LOCKED)</td>
Zhijun He228f4f92014-01-16 17:22:05 -0800945 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START</td>
946 * <td align="center">PRECAPTURE</td>
947 * <td align="center">Start AE precapture metering sequence</td>
948 * </tr>
Zhijun Hefa95b042015-02-09 10:40:49 -0800949 * <tr>
950 * <td align="center">Any state (excluding LOCKED)</td>
951 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is CANCEL</td>
952 * <td align="center">INACTIVE</td>
953 * <td align="center">Currently active precapture metering sequence is canceled</td>
954 * </tr>
Zhijun He228f4f92014-01-16 17:22:05 -0800955 * </tbody>
956 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -0800957 * <p>For the above table, the camera device may skip reporting any state changes that happen
958 * without application intervention (i.e. mode switch, trigger, locking). Any state that
959 * can be skipped in that manner is called a transient state.</p>
960 * <p>For example, for above AE modes (AE_MODE_ON_*), in addition to the state transitions
961 * listed in above table, it is also legal for the camera device to skip one or more
962 * transient states between two results. See below table for examples:</p>
963 * <table>
964 * <thead>
965 * <tr>
966 * <th align="center">State</th>
967 * <th align="center">Transition Cause</th>
968 * <th align="center">New State</th>
969 * <th align="center">Notes</th>
970 * </tr>
971 * </thead>
972 * <tbody>
973 * <tr>
974 * <td align="center">INACTIVE</td>
975 * <td align="center">Camera device finished AE scan</td>
976 * <td align="center">CONVERGED</td>
977 * <td align="center">Values are already good, transient states are skipped by camera device.</td>
978 * </tr>
979 * <tr>
Zhijun Hefa95b042015-02-09 10:40:49 -0800980 * <td align="center">Any state (excluding LOCKED)</td>
Zhijun He60b19dc2014-02-24 10:19:20 -0800981 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td>
982 * <td align="center">FLASH_REQUIRED</td>
983 * <td align="center">Converged but too dark w/o flash after a precapture sequence, transient states are skipped by camera device.</td>
984 * </tr>
985 * <tr>
Zhijun Hefa95b042015-02-09 10:40:49 -0800986 * <td align="center">Any state (excluding LOCKED)</td>
Zhijun He60b19dc2014-02-24 10:19:20 -0800987 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td>
988 * <td align="center">CONVERGED</td>
989 * <td align="center">Converged after a precapture sequence, transient states are skipped by camera device.</td>
990 * </tr>
991 * <tr>
Zhijun Hefa95b042015-02-09 10:40:49 -0800992 * <td align="center">Any state (excluding LOCKED)</td>
993 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is CANCEL, converged</td>
994 * <td align="center">FLASH_REQUIRED</td>
995 * <td align="center">Converged but too dark w/o flash after a precapture sequence is canceled, transient states are skipped by camera device.</td>
996 * </tr>
997 * <tr>
998 * <td align="center">Any state (excluding LOCKED)</td>
999 * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is CANCEL, converged</td>
1000 * <td align="center">CONVERGED</td>
1001 * <td align="center">Converged after a precapture sequenceis canceled, transient states are skipped by camera device.</td>
1002 * </tr>
1003 * <tr>
Zhijun He60b19dc2014-02-24 10:19:20 -08001004 * <td align="center">CONVERGED</td>
1005 * <td align="center">Camera device finished AE scan</td>
1006 * <td align="center">FLASH_REQUIRED</td>
1007 * <td align="center">Converged but too dark w/o flash after a new scan, transient states are skipped by camera device.</td>
1008 * </tr>
1009 * <tr>
1010 * <td align="center">FLASH_REQUIRED</td>
1011 * <td align="center">Camera device finished AE scan</td>
1012 * <td align="center">CONVERGED</td>
1013 * <td align="center">Converged after a new scan, transient states are skipped by camera device.</td>
1014 * </tr>
1015 * </tbody>
1016 * </table>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001017 * <p><b>Possible values:</b>
1018 * <ul>
1019 * <li>{@link #CONTROL_AE_STATE_INACTIVE INACTIVE}</li>
1020 * <li>{@link #CONTROL_AE_STATE_SEARCHING SEARCHING}</li>
1021 * <li>{@link #CONTROL_AE_STATE_CONVERGED CONVERGED}</li>
1022 * <li>{@link #CONTROL_AE_STATE_LOCKED LOCKED}</li>
1023 * <li>{@link #CONTROL_AE_STATE_FLASH_REQUIRED FLASH_REQUIRED}</li>
1024 * <li>{@link #CONTROL_AE_STATE_PRECAPTURE PRECAPTURE}</li>
1025 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001026 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1027 * <p><b>Limited capability</b> -
1028 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1029 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001030 *
1031 * @see CaptureRequest#CONTROL_AE_LOCK
1032 * @see CaptureRequest#CONTROL_AE_MODE
1033 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
1034 * @see CaptureRequest#CONTROL_MODE
1035 * @see CaptureRequest#CONTROL_SCENE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001036 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001037 * @see #CONTROL_AE_STATE_INACTIVE
1038 * @see #CONTROL_AE_STATE_SEARCHING
1039 * @see #CONTROL_AE_STATE_CONVERGED
1040 * @see #CONTROL_AE_STATE_LOCKED
1041 * @see #CONTROL_AE_STATE_FLASH_REQUIRED
1042 * @see #CONTROL_AE_STATE_PRECAPTURE
1043 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001044 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001045 public static final Key<Integer> CONTROL_AE_STATE =
1046 new Key<Integer>("android.control.aeState", int.class);
1047
1048 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001049 * <p>Whether auto-focus (AF) is currently enabled, and what
1050 * mode it is set to.</p>
Zhijun Hecc28a412014-02-24 15:11:23 -08001051 * <p>Only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} = AUTO and the lens is not fixed focus
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001052 * (i.e. <code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} &gt; 0</code>). Also note that
1053 * when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF, the behavior of AF is device
1054 * dependent. It is recommended to lock AF by using {@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger} before
1055 * setting {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} to OFF, or set AF mode to OFF when AE is OFF.</p>
Zhijun He78146ec2014-01-14 18:12:13 -08001056 * <p>If the lens is controlled by the camera device auto-focus algorithm,
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001057 * 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 -07001058 * in result metadata.</p>
1059 * <p><b>Possible values:</b>
1060 * <ul>
1061 * <li>{@link #CONTROL_AF_MODE_OFF OFF}</li>
1062 * <li>{@link #CONTROL_AF_MODE_AUTO AUTO}</li>
1063 * <li>{@link #CONTROL_AF_MODE_MACRO MACRO}</li>
1064 * <li>{@link #CONTROL_AF_MODE_CONTINUOUS_VIDEO CONTINUOUS_VIDEO}</li>
1065 * <li>{@link #CONTROL_AF_MODE_CONTINUOUS_PICTURE CONTINUOUS_PICTURE}</li>
1066 * <li>{@link #CONTROL_AF_MODE_EDOF EDOF}</li>
1067 * </ul></p>
1068 * <p><b>Available values for this device:</b><br>
1069 * {@link CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES android.control.afAvailableModes}</p>
1070 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001071 *
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001072 * @see CaptureRequest#CONTROL_AE_MODE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001073 * @see CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001074 * @see CaptureResult#CONTROL_AF_STATE
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001075 * @see CaptureRequest#CONTROL_AF_TRIGGER
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001076 * @see CaptureRequest#CONTROL_MODE
Zhijun Hecc28a412014-02-24 15:11:23 -08001077 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001078 * @see #CONTROL_AF_MODE_OFF
1079 * @see #CONTROL_AF_MODE_AUTO
1080 * @see #CONTROL_AF_MODE_MACRO
1081 * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO
1082 * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE
1083 * @see #CONTROL_AF_MODE_EDOF
1084 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001085 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001086 public static final Key<Integer> CONTROL_AF_MODE =
1087 new Key<Integer>("android.control.afMode", int.class);
1088
1089 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001090 * <p>List of metering areas to use for auto-focus.</p>
1091 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf} is 0.
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001092 * Otherwise will always be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001093 * <p>The maximum number of focus areas supported by the device is determined by the value
1094 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf}.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001095 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -07001096 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001097 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
1098 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001099 * bottom-right pixel in the active pixel array.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001100 * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001101 * for every pixel in the area. This means that a large metering area
1102 * with the same weight as a smaller area will have more effect in
1103 * the metering result. Metering areas can partially overlap and the
1104 * camera device will add the weights in the overlap region.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001105 * <p>The weights are relative to weights of other metering regions, so if only one region
1106 * is used, all non-zero weights will have the same effect. A region with 0 weight is
1107 * ignored.</p>
1108 * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
1109 * camera device.</p>
1110 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
1111 * capture result metadata, the camera device will ignore the sections outside the crop
1112 * region and output only the intersection rectangle as the metering region in the result
1113 * metadata. If the region is entirely outside the crop region, it will be ignored and
1114 * not reported in the result metadata.</p>
1115 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
1116 * <p><b>Range of valid values:</b><br>
1117 * Coordinates must be between <code>[(0,0), (width, height))</code> of
1118 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001119 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001120 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001121 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AF
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001122 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001123 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001124 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001125 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001126 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AF_REGIONS =
1127 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.afRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001128
1129 /**
Zhijun He379af012014-05-06 11:54:54 -07001130 * <p>Whether the camera device will trigger autofocus for this request.</p>
1131 * <p>This entry is normally set to IDLE, or is not
1132 * included at all in the request settings.</p>
1133 * <p>When included and set to START, the camera device will trigger the
1134 * autofocus algorithm. If autofocus is disabled, this trigger has no effect.</p>
1135 * <p>When set to CANCEL, the camera device will cancel any active trigger,
1136 * and return to its initial AF state.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001137 * <p>Generally, applications should set this entry to START or CANCEL for only a
1138 * single capture, and then return it to IDLE (or not set at all). Specifying
1139 * START for multiple captures in a row means restarting the AF operation over
1140 * and over again.</p>
1141 * <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 -07001142 * <p><b>Possible values:</b>
1143 * <ul>
1144 * <li>{@link #CONTROL_AF_TRIGGER_IDLE IDLE}</li>
1145 * <li>{@link #CONTROL_AF_TRIGGER_START START}</li>
1146 * <li>{@link #CONTROL_AF_TRIGGER_CANCEL CANCEL}</li>
1147 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001148 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001149 *
1150 * @see CaptureResult#CONTROL_AF_STATE
1151 * @see #CONTROL_AF_TRIGGER_IDLE
1152 * @see #CONTROL_AF_TRIGGER_START
1153 * @see #CONTROL_AF_TRIGGER_CANCEL
1154 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001155 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001156 public static final Key<Integer> CONTROL_AF_TRIGGER =
1157 new Key<Integer>("android.control.afTrigger", int.class);
1158
1159 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001160 * <p>Current state of auto-focus (AF) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001161 * <p>Switching between or enabling AF modes ({@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}) always
1162 * resets the AF state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
1163 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
1164 * the algorithm states to INACTIVE.</p>
1165 * <p>The camera device can do several state transitions between two results, if it is
1166 * allowed by the state transition table. For example: INACTIVE may never actually be
1167 * seen in a result.</p>
1168 * <p>The state in the result is the state for this image (in sync with this image): if
1169 * AF state becomes FOCUSED, then the image data associated with this result should
1170 * be sharp.</p>
1171 * <p>Below are state transition tables for different AF modes.</p>
1172 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_OFF or AF_MODE_EDOF:</p>
1173 * <table>
1174 * <thead>
1175 * <tr>
1176 * <th align="center">State</th>
1177 * <th align="center">Transition Cause</th>
1178 * <th align="center">New State</th>
1179 * <th align="center">Notes</th>
1180 * </tr>
1181 * </thead>
1182 * <tbody>
1183 * <tr>
1184 * <td align="center">INACTIVE</td>
1185 * <td align="center"></td>
1186 * <td align="center">INACTIVE</td>
1187 * <td align="center">Never changes</td>
1188 * </tr>
1189 * </tbody>
1190 * </table>
1191 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_AUTO or AF_MODE_MACRO:</p>
1192 * <table>
1193 * <thead>
1194 * <tr>
1195 * <th align="center">State</th>
1196 * <th align="center">Transition Cause</th>
1197 * <th align="center">New State</th>
1198 * <th align="center">Notes</th>
1199 * </tr>
1200 * </thead>
1201 * <tbody>
1202 * <tr>
1203 * <td align="center">INACTIVE</td>
1204 * <td align="center">AF_TRIGGER</td>
1205 * <td align="center">ACTIVE_SCAN</td>
1206 * <td align="center">Start AF sweep, Lens now moving</td>
1207 * </tr>
1208 * <tr>
1209 * <td align="center">ACTIVE_SCAN</td>
1210 * <td align="center">AF sweep done</td>
1211 * <td align="center">FOCUSED_LOCKED</td>
1212 * <td align="center">Focused, Lens now locked</td>
1213 * </tr>
1214 * <tr>
1215 * <td align="center">ACTIVE_SCAN</td>
1216 * <td align="center">AF sweep done</td>
1217 * <td align="center">NOT_FOCUSED_LOCKED</td>
1218 * <td align="center">Not focused, Lens now locked</td>
1219 * </tr>
1220 * <tr>
1221 * <td align="center">ACTIVE_SCAN</td>
1222 * <td align="center">AF_CANCEL</td>
1223 * <td align="center">INACTIVE</td>
1224 * <td align="center">Cancel/reset AF, Lens now locked</td>
1225 * </tr>
1226 * <tr>
1227 * <td align="center">FOCUSED_LOCKED</td>
1228 * <td align="center">AF_CANCEL</td>
1229 * <td align="center">INACTIVE</td>
1230 * <td align="center">Cancel/reset AF</td>
1231 * </tr>
1232 * <tr>
1233 * <td align="center">FOCUSED_LOCKED</td>
1234 * <td align="center">AF_TRIGGER</td>
1235 * <td align="center">ACTIVE_SCAN</td>
1236 * <td align="center">Start new sweep, Lens now moving</td>
1237 * </tr>
1238 * <tr>
1239 * <td align="center">NOT_FOCUSED_LOCKED</td>
1240 * <td align="center">AF_CANCEL</td>
1241 * <td align="center">INACTIVE</td>
1242 * <td align="center">Cancel/reset AF</td>
1243 * </tr>
1244 * <tr>
1245 * <td align="center">NOT_FOCUSED_LOCKED</td>
1246 * <td align="center">AF_TRIGGER</td>
1247 * <td align="center">ACTIVE_SCAN</td>
1248 * <td align="center">Start new sweep, Lens now moving</td>
1249 * </tr>
1250 * <tr>
1251 * <td align="center">Any state</td>
1252 * <td align="center">Mode change</td>
1253 * <td align="center">INACTIVE</td>
1254 * <td align="center"></td>
1255 * </tr>
1256 * </tbody>
1257 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -08001258 * <p>For the above table, the camera device may skip reporting any state changes that happen
1259 * without application intervention (i.e. mode switch, trigger, locking). Any state that
1260 * can be skipped in that manner is called a transient state.</p>
1261 * <p>For example, for these AF modes (AF_MODE_AUTO and AF_MODE_MACRO), in addition to the
1262 * state transitions listed in above table, it is also legal for the camera device to skip
1263 * one or more transient states between two results. See below table for examples:</p>
1264 * <table>
1265 * <thead>
1266 * <tr>
1267 * <th align="center">State</th>
1268 * <th align="center">Transition Cause</th>
1269 * <th align="center">New State</th>
1270 * <th align="center">Notes</th>
1271 * </tr>
1272 * </thead>
1273 * <tbody>
1274 * <tr>
1275 * <td align="center">INACTIVE</td>
1276 * <td align="center">AF_TRIGGER</td>
1277 * <td align="center">FOCUSED_LOCKED</td>
1278 * <td align="center">Focus is already good or good after a scan, lens is now locked.</td>
1279 * </tr>
1280 * <tr>
1281 * <td align="center">INACTIVE</td>
1282 * <td align="center">AF_TRIGGER</td>
1283 * <td align="center">NOT_FOCUSED_LOCKED</td>
1284 * <td align="center">Focus failed after a scan, lens is now locked.</td>
1285 * </tr>
1286 * <tr>
1287 * <td align="center">FOCUSED_LOCKED</td>
1288 * <td align="center">AF_TRIGGER</td>
1289 * <td align="center">FOCUSED_LOCKED</td>
1290 * <td align="center">Focus is already good or good after a scan, lens is now locked.</td>
1291 * </tr>
1292 * <tr>
1293 * <td align="center">NOT_FOCUSED_LOCKED</td>
1294 * <td align="center">AF_TRIGGER</td>
1295 * <td align="center">FOCUSED_LOCKED</td>
1296 * <td align="center">Focus is good after a scan, lens is not locked.</td>
1297 * </tr>
1298 * </tbody>
1299 * </table>
Zhijun He228f4f92014-01-16 17:22:05 -08001300 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_VIDEO:</p>
1301 * <table>
1302 * <thead>
1303 * <tr>
1304 * <th align="center">State</th>
1305 * <th align="center">Transition Cause</th>
1306 * <th align="center">New State</th>
1307 * <th align="center">Notes</th>
1308 * </tr>
1309 * </thead>
1310 * <tbody>
1311 * <tr>
1312 * <td align="center">INACTIVE</td>
1313 * <td align="center">Camera device initiates new scan</td>
1314 * <td align="center">PASSIVE_SCAN</td>
1315 * <td align="center">Start AF scan, Lens now moving</td>
1316 * </tr>
1317 * <tr>
1318 * <td align="center">INACTIVE</td>
1319 * <td align="center">AF_TRIGGER</td>
1320 * <td align="center">NOT_FOCUSED_LOCKED</td>
1321 * <td align="center">AF state query, Lens now locked</td>
1322 * </tr>
1323 * <tr>
1324 * <td align="center">PASSIVE_SCAN</td>
1325 * <td align="center">Camera device completes current scan</td>
1326 * <td align="center">PASSIVE_FOCUSED</td>
1327 * <td align="center">End AF scan, Lens now locked</td>
1328 * </tr>
1329 * <tr>
1330 * <td align="center">PASSIVE_SCAN</td>
1331 * <td align="center">Camera device fails current scan</td>
1332 * <td align="center">PASSIVE_UNFOCUSED</td>
1333 * <td align="center">End AF scan, Lens now locked</td>
1334 * </tr>
1335 * <tr>
1336 * <td align="center">PASSIVE_SCAN</td>
1337 * <td align="center">AF_TRIGGER</td>
1338 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001339 * <td align="center">Immediate transition, if focus is good. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001340 * </tr>
1341 * <tr>
1342 * <td align="center">PASSIVE_SCAN</td>
1343 * <td align="center">AF_TRIGGER</td>
1344 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001345 * <td align="center">Immediate transition, if focus is bad. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001346 * </tr>
1347 * <tr>
1348 * <td align="center">PASSIVE_SCAN</td>
1349 * <td align="center">AF_CANCEL</td>
1350 * <td align="center">INACTIVE</td>
1351 * <td align="center">Reset lens position, Lens now locked</td>
1352 * </tr>
1353 * <tr>
1354 * <td align="center">PASSIVE_FOCUSED</td>
1355 * <td align="center">Camera device initiates new scan</td>
1356 * <td align="center">PASSIVE_SCAN</td>
1357 * <td align="center">Start AF scan, Lens now moving</td>
1358 * </tr>
1359 * <tr>
1360 * <td align="center">PASSIVE_UNFOCUSED</td>
1361 * <td align="center">Camera device initiates new scan</td>
1362 * <td align="center">PASSIVE_SCAN</td>
1363 * <td align="center">Start AF scan, Lens now moving</td>
1364 * </tr>
1365 * <tr>
1366 * <td align="center">PASSIVE_FOCUSED</td>
1367 * <td align="center">AF_TRIGGER</td>
1368 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001369 * <td align="center">Immediate transition, lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001370 * </tr>
1371 * <tr>
1372 * <td align="center">PASSIVE_UNFOCUSED</td>
1373 * <td align="center">AF_TRIGGER</td>
1374 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001375 * <td align="center">Immediate transition, lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001376 * </tr>
1377 * <tr>
1378 * <td align="center">FOCUSED_LOCKED</td>
1379 * <td align="center">AF_TRIGGER</td>
1380 * <td align="center">FOCUSED_LOCKED</td>
1381 * <td align="center">No effect</td>
1382 * </tr>
1383 * <tr>
1384 * <td align="center">FOCUSED_LOCKED</td>
1385 * <td align="center">AF_CANCEL</td>
1386 * <td align="center">INACTIVE</td>
1387 * <td align="center">Restart AF scan</td>
1388 * </tr>
1389 * <tr>
1390 * <td align="center">NOT_FOCUSED_LOCKED</td>
1391 * <td align="center">AF_TRIGGER</td>
1392 * <td align="center">NOT_FOCUSED_LOCKED</td>
1393 * <td align="center">No effect</td>
1394 * </tr>
1395 * <tr>
1396 * <td align="center">NOT_FOCUSED_LOCKED</td>
1397 * <td align="center">AF_CANCEL</td>
1398 * <td align="center">INACTIVE</td>
1399 * <td align="center">Restart AF scan</td>
1400 * </tr>
1401 * </tbody>
1402 * </table>
1403 * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_PICTURE:</p>
1404 * <table>
1405 * <thead>
1406 * <tr>
1407 * <th align="center">State</th>
1408 * <th align="center">Transition Cause</th>
1409 * <th align="center">New State</th>
1410 * <th align="center">Notes</th>
1411 * </tr>
1412 * </thead>
1413 * <tbody>
1414 * <tr>
1415 * <td align="center">INACTIVE</td>
1416 * <td align="center">Camera device initiates new scan</td>
1417 * <td align="center">PASSIVE_SCAN</td>
1418 * <td align="center">Start AF scan, Lens now moving</td>
1419 * </tr>
1420 * <tr>
1421 * <td align="center">INACTIVE</td>
1422 * <td align="center">AF_TRIGGER</td>
1423 * <td align="center">NOT_FOCUSED_LOCKED</td>
1424 * <td align="center">AF state query, Lens now locked</td>
1425 * </tr>
1426 * <tr>
1427 * <td align="center">PASSIVE_SCAN</td>
1428 * <td align="center">Camera device completes current scan</td>
1429 * <td align="center">PASSIVE_FOCUSED</td>
1430 * <td align="center">End AF scan, Lens now locked</td>
1431 * </tr>
1432 * <tr>
1433 * <td align="center">PASSIVE_SCAN</td>
1434 * <td align="center">Camera device fails current scan</td>
1435 * <td align="center">PASSIVE_UNFOCUSED</td>
1436 * <td align="center">End AF scan, Lens now locked</td>
1437 * </tr>
1438 * <tr>
1439 * <td align="center">PASSIVE_SCAN</td>
1440 * <td align="center">AF_TRIGGER</td>
1441 * <td align="center">FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001442 * <td align="center">Eventual transition once the focus is good. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001443 * </tr>
1444 * <tr>
1445 * <td align="center">PASSIVE_SCAN</td>
1446 * <td align="center">AF_TRIGGER</td>
1447 * <td align="center">NOT_FOCUSED_LOCKED</td>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001448 * <td align="center">Eventual transition if cannot find focus. Lens now locked</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001449 * </tr>
1450 * <tr>
1451 * <td align="center">PASSIVE_SCAN</td>
1452 * <td align="center">AF_CANCEL</td>
1453 * <td align="center">INACTIVE</td>
1454 * <td align="center">Reset lens position, Lens now locked</td>
1455 * </tr>
1456 * <tr>
1457 * <td align="center">PASSIVE_FOCUSED</td>
1458 * <td align="center">Camera device initiates new scan</td>
1459 * <td align="center">PASSIVE_SCAN</td>
1460 * <td align="center">Start AF scan, Lens now moving</td>
1461 * </tr>
1462 * <tr>
1463 * <td align="center">PASSIVE_UNFOCUSED</td>
1464 * <td align="center">Camera device initiates new scan</td>
1465 * <td align="center">PASSIVE_SCAN</td>
1466 * <td align="center">Start AF scan, Lens now moving</td>
1467 * </tr>
1468 * <tr>
1469 * <td align="center">PASSIVE_FOCUSED</td>
1470 * <td align="center">AF_TRIGGER</td>
1471 * <td align="center">FOCUSED_LOCKED</td>
1472 * <td align="center">Immediate trans. Lens now locked</td>
1473 * </tr>
1474 * <tr>
1475 * <td align="center">PASSIVE_UNFOCUSED</td>
1476 * <td align="center">AF_TRIGGER</td>
1477 * <td align="center">NOT_FOCUSED_LOCKED</td>
1478 * <td align="center">Immediate trans. Lens now locked</td>
1479 * </tr>
1480 * <tr>
1481 * <td align="center">FOCUSED_LOCKED</td>
1482 * <td align="center">AF_TRIGGER</td>
1483 * <td align="center">FOCUSED_LOCKED</td>
1484 * <td align="center">No effect</td>
1485 * </tr>
1486 * <tr>
1487 * <td align="center">FOCUSED_LOCKED</td>
1488 * <td align="center">AF_CANCEL</td>
1489 * <td align="center">INACTIVE</td>
1490 * <td align="center">Restart AF scan</td>
1491 * </tr>
1492 * <tr>
1493 * <td align="center">NOT_FOCUSED_LOCKED</td>
1494 * <td align="center">AF_TRIGGER</td>
1495 * <td align="center">NOT_FOCUSED_LOCKED</td>
1496 * <td align="center">No effect</td>
1497 * </tr>
1498 * <tr>
1499 * <td align="center">NOT_FOCUSED_LOCKED</td>
1500 * <td align="center">AF_CANCEL</td>
1501 * <td align="center">INACTIVE</td>
1502 * <td align="center">Restart AF scan</td>
1503 * </tr>
1504 * </tbody>
1505 * </table>
Zhijun He60b19dc2014-02-24 10:19:20 -08001506 * <p>When switch between AF_MODE_CONTINUOUS_* (CAF modes) and AF_MODE_AUTO/AF_MODE_MACRO
1507 * (AUTO modes), the initial INACTIVE or PASSIVE_SCAN states may be skipped by the
1508 * camera device. When a trigger is included in a mode switch request, the trigger
1509 * will be evaluated in the context of the new mode in the request.
1510 * See below table for examples:</p>
1511 * <table>
1512 * <thead>
1513 * <tr>
1514 * <th align="center">State</th>
1515 * <th align="center">Transition Cause</th>
1516 * <th align="center">New State</th>
1517 * <th align="center">Notes</th>
1518 * </tr>
1519 * </thead>
1520 * <tbody>
1521 * <tr>
1522 * <td align="center">any state</td>
1523 * <td align="center">CAF--&gt;AUTO mode switch</td>
1524 * <td align="center">INACTIVE</td>
1525 * <td align="center">Mode switch without trigger, initial state must be INACTIVE</td>
1526 * </tr>
1527 * <tr>
1528 * <td align="center">any state</td>
1529 * <td align="center">CAF--&gt;AUTO mode switch with AF_TRIGGER</td>
1530 * <td align="center">trigger-reachable states from INACTIVE</td>
1531 * <td align="center">Mode switch with trigger, INACTIVE is skipped</td>
1532 * </tr>
1533 * <tr>
1534 * <td align="center">any state</td>
1535 * <td align="center">AUTO--&gt;CAF mode switch</td>
1536 * <td align="center">passively reachable states from INACTIVE</td>
1537 * <td align="center">Mode switch without trigger, passive transient state is skipped</td>
1538 * </tr>
1539 * </tbody>
1540 * </table>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001541 * <p><b>Possible values:</b>
1542 * <ul>
1543 * <li>{@link #CONTROL_AF_STATE_INACTIVE INACTIVE}</li>
1544 * <li>{@link #CONTROL_AF_STATE_PASSIVE_SCAN PASSIVE_SCAN}</li>
1545 * <li>{@link #CONTROL_AF_STATE_PASSIVE_FOCUSED PASSIVE_FOCUSED}</li>
1546 * <li>{@link #CONTROL_AF_STATE_ACTIVE_SCAN ACTIVE_SCAN}</li>
1547 * <li>{@link #CONTROL_AF_STATE_FOCUSED_LOCKED FOCUSED_LOCKED}</li>
1548 * <li>{@link #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED NOT_FOCUSED_LOCKED}</li>
1549 * <li>{@link #CONTROL_AF_STATE_PASSIVE_UNFOCUSED PASSIVE_UNFOCUSED}</li>
1550 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001551 * <p>This key is available on all devices.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001552 *
1553 * @see CaptureRequest#CONTROL_AF_MODE
1554 * @see CaptureRequest#CONTROL_MODE
1555 * @see CaptureRequest#CONTROL_SCENE_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001556 * @see #CONTROL_AF_STATE_INACTIVE
1557 * @see #CONTROL_AF_STATE_PASSIVE_SCAN
1558 * @see #CONTROL_AF_STATE_PASSIVE_FOCUSED
1559 * @see #CONTROL_AF_STATE_ACTIVE_SCAN
1560 * @see #CONTROL_AF_STATE_FOCUSED_LOCKED
1561 * @see #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED
Eino-Ville Talvala9f880f72013-09-20 17:50:41 -07001562 * @see #CONTROL_AF_STATE_PASSIVE_UNFOCUSED
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001563 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001564 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001565 public static final Key<Integer> CONTROL_AF_STATE =
1566 new Key<Integer>("android.control.afState", int.class);
1567
1568 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001569 * <p>Whether auto-white balance (AWB) is currently locked to its
Zhijun He379af012014-05-06 11:54:54 -07001570 * latest calculated values.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001571 * <p>When set to <code>true</code> (ON), the AWB algorithm is locked to its latest parameters,
1572 * and will not change color balance settings until the lock is set to <code>false</code> (OFF).</p>
1573 * <p>Since the camera device has a pipeline of in-flight requests, the settings that
1574 * get locked do not necessarily correspond to the settings that were present in the
1575 * latest capture result received from the camera device, since additional captures
1576 * and AWB updates may have occurred even before the result was sent out. If an
1577 * application is switching between automatic and manual control and wishes to eliminate
1578 * any flicker during the switch, the following procedure is recommended:</p>
1579 * <ol>
1580 * <li>Starting in auto-AWB mode:</li>
1581 * <li>Lock AWB</li>
1582 * <li>Wait for the first result to be output that has the AWB locked</li>
1583 * <li>Copy AWB settings from that result into a request, set the request to manual AWB</li>
1584 * <li>Submit the capture request, proceed to run manual AWB as desired.</li>
1585 * </ol>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001586 * <p>Note that AWB lock is only meaningful when
1587 * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is in the AUTO mode; in other modes,
1588 * AWB is already fixed to a specific setting.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001589 * <p>Some LEGACY devices may not support ON; the value is then overridden to OFF.</p>
1590 * <p>This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001591 *
1592 * @see CaptureRequest#CONTROL_AWB_MODE
Zhijun He379af012014-05-06 11:54:54 -07001593 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001594 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001595 public static final Key<Boolean> CONTROL_AWB_LOCK =
1596 new Key<Boolean>("android.control.awbLock", boolean.class);
1597
1598 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001599 * <p>Whether auto-white balance (AWB) is currently setting the color
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001600 * transform fields, and what its illumination target
Zhijun Hecc28a412014-02-24 15:11:23 -08001601 * is.</p>
Zhijun He399f05d2014-01-15 11:31:30 -08001602 * <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 -07001603 * <p>When set to the ON mode, the camera device's auto-white balance
Zhijun He399f05d2014-01-15 11:31:30 -08001604 * routine is enabled, overriding the application's selected
1605 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001606 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}. Note that when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}
1607 * is OFF, the behavior of AWB is device dependent. It is recommened to
1608 * also set AWB mode to OFF or lock AWB by using {@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} before
1609 * setting AE mode to OFF.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001610 * <p>When set to the OFF mode, the camera device's auto-white balance
Zhijun Hecc28a412014-02-24 15:11:23 -08001611 * routine is disabled. The application manually controls the white
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08001612 * 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 -08001613 * and {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001614 * <p>When set to any other modes, the camera device's auto-white
1615 * balance routine is disabled. The camera device uses each
1616 * particular illumination target for white balance
1617 * adjustment. The application's values for
1618 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform},
1619 * {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
1620 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} are ignored.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001621 * <p><b>Possible values:</b>
1622 * <ul>
1623 * <li>{@link #CONTROL_AWB_MODE_OFF OFF}</li>
1624 * <li>{@link #CONTROL_AWB_MODE_AUTO AUTO}</li>
1625 * <li>{@link #CONTROL_AWB_MODE_INCANDESCENT INCANDESCENT}</li>
1626 * <li>{@link #CONTROL_AWB_MODE_FLUORESCENT FLUORESCENT}</li>
1627 * <li>{@link #CONTROL_AWB_MODE_WARM_FLUORESCENT WARM_FLUORESCENT}</li>
1628 * <li>{@link #CONTROL_AWB_MODE_DAYLIGHT DAYLIGHT}</li>
1629 * <li>{@link #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT CLOUDY_DAYLIGHT}</li>
1630 * <li>{@link #CONTROL_AWB_MODE_TWILIGHT TWILIGHT}</li>
1631 * <li>{@link #CONTROL_AWB_MODE_SHADE SHADE}</li>
1632 * </ul></p>
1633 * <p><b>Available values for this device:</b><br>
1634 * {@link CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES android.control.awbAvailableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001635 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001636 *
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001637 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Zhijun He5f2a47f2014-01-16 15:44:41 -08001638 * @see CaptureRequest#COLOR_CORRECTION_MODE
1639 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001640 * @see CaptureRequest#CONTROL_AE_MODE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001641 * @see CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES
Yin-Chia Yeh7144b5d2014-11-12 11:42:49 -08001642 * @see CaptureRequest#CONTROL_AWB_LOCK
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001643 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001644 * @see #CONTROL_AWB_MODE_OFF
1645 * @see #CONTROL_AWB_MODE_AUTO
1646 * @see #CONTROL_AWB_MODE_INCANDESCENT
1647 * @see #CONTROL_AWB_MODE_FLUORESCENT
1648 * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT
1649 * @see #CONTROL_AWB_MODE_DAYLIGHT
1650 * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT
1651 * @see #CONTROL_AWB_MODE_TWILIGHT
1652 * @see #CONTROL_AWB_MODE_SHADE
1653 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001654 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001655 public static final Key<Integer> CONTROL_AWB_MODE =
1656 new Key<Integer>("android.control.awbMode", int.class);
1657
1658 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001659 * <p>List of metering areas to use for auto-white-balance illuminant
Ruben Brunkf59521d2014-02-03 17:14:33 -08001660 * estimation.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001661 * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb} is 0.
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001662 * Otherwise will always be present.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001663 * <p>The maximum number of regions supported by the device is determined by the value
1664 * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb}.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08001665 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -07001666 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001667 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
1668 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Yin-Chia Yeh97f1c852014-05-28 16:36:05 -07001669 * bottom-right pixel in the active pixel array.</p>
1670 * <p>The weight must range from 0 to 1000, and represents a weight
1671 * for every pixel in the area. This means that a large metering area
1672 * with the same weight as a smaller area will have more effect in
1673 * the metering result. Metering areas can partially overlap and the
1674 * camera device will add the weights in the overlap region.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001675 * <p>The weights are relative to weights of other white balance metering regions, so if
1676 * only one region is used, all non-zero weights will have the same effect. A region with
1677 * 0 weight is ignored.</p>
1678 * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
1679 * camera device.</p>
1680 * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
1681 * capture result metadata, the camera device will ignore the sections outside the crop
1682 * region and output only the intersection rectangle as the metering region in the result
1683 * metadata. If the region is entirely outside the crop region, it will be ignored and
1684 * not reported in the result metadata.</p>
1685 * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
1686 * <p><b>Range of valid values:</b><br>
1687 * Coordinates must be between <code>[(0,0), (width, height))</code> of
1688 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001689 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001690 *
Yin-Chia Yeh808150f2014-09-08 15:48:47 -07001691 * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AWB
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001692 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08001693 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001694 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001695 @PublicKey
Yin-Chia Yeh817f8932014-05-19 10:23:27 -07001696 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS =
1697 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.awbRegions", android.hardware.camera2.params.MeteringRectangle[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001698
1699 /**
Zhijun He379af012014-05-06 11:54:54 -07001700 * <p>Information to the camera device 3A (auto-exposure,
1701 * auto-focus, auto-white balance) routines about the purpose
1702 * of this capture, to help the camera device to decide optimal 3A
1703 * strategy.</p>
1704 * <p>This control (except for MANUAL) is only effective if
1705 * <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 -07001706 * <p>ZERO_SHUTTER_LAG will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
Chien-Yu Chen8062d312015-05-12 14:24:10 -07001707 * contains PRIVATE_REPROCESSING or YUV_REPROCESSING. MANUAL will be supported if
Zhijun He513f7c32015-04-24 18:23:54 -07001708 * {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains MANUAL_SENSOR. Other intent values are
1709 * always supported.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001710 * <p><b>Possible values:</b>
1711 * <ul>
1712 * <li>{@link #CONTROL_CAPTURE_INTENT_CUSTOM CUSTOM}</li>
1713 * <li>{@link #CONTROL_CAPTURE_INTENT_PREVIEW PREVIEW}</li>
1714 * <li>{@link #CONTROL_CAPTURE_INTENT_STILL_CAPTURE STILL_CAPTURE}</li>
1715 * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_RECORD VIDEO_RECORD}</li>
1716 * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT VIDEO_SNAPSHOT}</li>
1717 * <li>{@link #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li>
1718 * <li>{@link #CONTROL_CAPTURE_INTENT_MANUAL MANUAL}</li>
1719 * </ul></p>
1720 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001721 *
1722 * @see CaptureRequest#CONTROL_MODE
1723 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1724 * @see #CONTROL_CAPTURE_INTENT_CUSTOM
1725 * @see #CONTROL_CAPTURE_INTENT_PREVIEW
1726 * @see #CONTROL_CAPTURE_INTENT_STILL_CAPTURE
1727 * @see #CONTROL_CAPTURE_INTENT_VIDEO_RECORD
1728 * @see #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT
1729 * @see #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG
1730 * @see #CONTROL_CAPTURE_INTENT_MANUAL
1731 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001732 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001733 public static final Key<Integer> CONTROL_CAPTURE_INTENT =
1734 new Key<Integer>("android.control.captureIntent", int.class);
1735
1736 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07001737 * <p>Current state of auto-white balance (AWB) algorithm.</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001738 * <p>Switching between or enabling AWB modes ({@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}) always
1739 * resets the AWB state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
1740 * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
1741 * the algorithm states to INACTIVE.</p>
1742 * <p>The camera device can do several state transitions between two results, if it is
1743 * allowed by the state transition table. So INACTIVE may never actually be seen in
1744 * a result.</p>
1745 * <p>The state in the result is the state for this image (in sync with this image): if
1746 * AWB state becomes CONVERGED, then the image data associated with this result should
1747 * be good to use.</p>
1748 * <p>Below are state transition tables for different AWB modes.</p>
1749 * <p>When <code>{@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} != AWB_MODE_AUTO</code>:</p>
1750 * <table>
1751 * <thead>
1752 * <tr>
1753 * <th align="center">State</th>
1754 * <th align="center">Transition Cause</th>
1755 * <th align="center">New State</th>
1756 * <th align="center">Notes</th>
1757 * </tr>
1758 * </thead>
1759 * <tbody>
1760 * <tr>
1761 * <td align="center">INACTIVE</td>
1762 * <td align="center"></td>
1763 * <td align="center">INACTIVE</td>
1764 * <td align="center">Camera device auto white balance algorithm is disabled</td>
1765 * </tr>
1766 * </tbody>
1767 * </table>
1768 * <p>When {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is AWB_MODE_AUTO:</p>
1769 * <table>
1770 * <thead>
1771 * <tr>
1772 * <th align="center">State</th>
1773 * <th align="center">Transition Cause</th>
1774 * <th align="center">New State</th>
1775 * <th align="center">Notes</th>
1776 * </tr>
1777 * </thead>
1778 * <tbody>
1779 * <tr>
1780 * <td align="center">INACTIVE</td>
1781 * <td align="center">Camera device initiates AWB scan</td>
1782 * <td align="center">SEARCHING</td>
1783 * <td align="center">Values changing</td>
1784 * </tr>
1785 * <tr>
1786 * <td align="center">INACTIVE</td>
1787 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1788 * <td align="center">LOCKED</td>
1789 * <td align="center">Values locked</td>
1790 * </tr>
1791 * <tr>
1792 * <td align="center">SEARCHING</td>
1793 * <td align="center">Camera device finishes AWB scan</td>
1794 * <td align="center">CONVERGED</td>
1795 * <td align="center">Good values, not changing</td>
1796 * </tr>
1797 * <tr>
1798 * <td align="center">SEARCHING</td>
1799 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1800 * <td align="center">LOCKED</td>
1801 * <td align="center">Values locked</td>
1802 * </tr>
1803 * <tr>
1804 * <td align="center">CONVERGED</td>
1805 * <td align="center">Camera device initiates AWB scan</td>
1806 * <td align="center">SEARCHING</td>
1807 * <td align="center">Values changing</td>
1808 * </tr>
1809 * <tr>
1810 * <td align="center">CONVERGED</td>
1811 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1812 * <td align="center">LOCKED</td>
1813 * <td align="center">Values locked</td>
1814 * </tr>
1815 * <tr>
1816 * <td align="center">LOCKED</td>
1817 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
1818 * <td align="center">SEARCHING</td>
1819 * <td align="center">Values not good after unlock</td>
1820 * </tr>
Zhijun He60b19dc2014-02-24 10:19:20 -08001821 * </tbody>
1822 * </table>
1823 * <p>For the above table, the camera device may skip reporting any state changes that happen
1824 * without application intervention (i.e. mode switch, trigger, locking). Any state that
1825 * can be skipped in that manner is called a transient state.</p>
1826 * <p>For example, for this AWB mode (AWB_MODE_AUTO), in addition to the state transitions
1827 * listed in above table, it is also legal for the camera device to skip one or more
1828 * transient states between two results. See below table for examples:</p>
1829 * <table>
1830 * <thead>
1831 * <tr>
1832 * <th align="center">State</th>
1833 * <th align="center">Transition Cause</th>
1834 * <th align="center">New State</th>
1835 * <th align="center">Notes</th>
1836 * </tr>
1837 * </thead>
1838 * <tbody>
1839 * <tr>
1840 * <td align="center">INACTIVE</td>
1841 * <td align="center">Camera device finished AWB scan</td>
1842 * <td align="center">CONVERGED</td>
1843 * <td align="center">Values are already good, transient states are skipped by camera device.</td>
1844 * </tr>
Zhijun He228f4f92014-01-16 17:22:05 -08001845 * <tr>
1846 * <td align="center">LOCKED</td>
1847 * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
1848 * <td align="center">CONVERGED</td>
Zhijun He60b19dc2014-02-24 10:19:20 -08001849 * <td align="center">Values good after unlock, transient states are skipped by camera device.</td>
Zhijun He228f4f92014-01-16 17:22:05 -08001850 * </tr>
1851 * </tbody>
1852 * </table>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001853 * <p><b>Possible values:</b>
1854 * <ul>
1855 * <li>{@link #CONTROL_AWB_STATE_INACTIVE INACTIVE}</li>
1856 * <li>{@link #CONTROL_AWB_STATE_SEARCHING SEARCHING}</li>
1857 * <li>{@link #CONTROL_AWB_STATE_CONVERGED CONVERGED}</li>
1858 * <li>{@link #CONTROL_AWB_STATE_LOCKED LOCKED}</li>
1859 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001860 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1861 * <p><b>Limited capability</b> -
1862 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1863 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He228f4f92014-01-16 17:22:05 -08001864 *
1865 * @see CaptureRequest#CONTROL_AWB_LOCK
1866 * @see CaptureRequest#CONTROL_AWB_MODE
1867 * @see CaptureRequest#CONTROL_MODE
1868 * @see CaptureRequest#CONTROL_SCENE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001869 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001870 * @see #CONTROL_AWB_STATE_INACTIVE
1871 * @see #CONTROL_AWB_STATE_SEARCHING
1872 * @see #CONTROL_AWB_STATE_CONVERGED
1873 * @see #CONTROL_AWB_STATE_LOCKED
1874 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001875 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001876 public static final Key<Integer> CONTROL_AWB_STATE =
1877 new Key<Integer>("android.control.awbState", int.class);
1878
1879 /**
Zhijun He379af012014-05-06 11:54:54 -07001880 * <p>A special color effect to apply.</p>
1881 * <p>When this mode is set, a color effect will be applied
1882 * to images produced by the camera device. The interpretation
1883 * and implementation of these color effects is left to the
1884 * implementor of the camera device, and should not be
1885 * depended on to be consistent (or present) across all
1886 * devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001887 * <p><b>Possible values:</b>
1888 * <ul>
1889 * <li>{@link #CONTROL_EFFECT_MODE_OFF OFF}</li>
1890 * <li>{@link #CONTROL_EFFECT_MODE_MONO MONO}</li>
1891 * <li>{@link #CONTROL_EFFECT_MODE_NEGATIVE NEGATIVE}</li>
1892 * <li>{@link #CONTROL_EFFECT_MODE_SOLARIZE SOLARIZE}</li>
1893 * <li>{@link #CONTROL_EFFECT_MODE_SEPIA SEPIA}</li>
1894 * <li>{@link #CONTROL_EFFECT_MODE_POSTERIZE POSTERIZE}</li>
1895 * <li>{@link #CONTROL_EFFECT_MODE_WHITEBOARD WHITEBOARD}</li>
1896 * <li>{@link #CONTROL_EFFECT_MODE_BLACKBOARD BLACKBOARD}</li>
1897 * <li>{@link #CONTROL_EFFECT_MODE_AQUA AQUA}</li>
1898 * </ul></p>
1899 * <p><b>Available values for this device:</b><br>
1900 * {@link CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS android.control.availableEffects}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001901 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001902 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001903 * @see CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS
Zhijun He379af012014-05-06 11:54:54 -07001904 * @see #CONTROL_EFFECT_MODE_OFF
1905 * @see #CONTROL_EFFECT_MODE_MONO
1906 * @see #CONTROL_EFFECT_MODE_NEGATIVE
1907 * @see #CONTROL_EFFECT_MODE_SOLARIZE
1908 * @see #CONTROL_EFFECT_MODE_SEPIA
1909 * @see #CONTROL_EFFECT_MODE_POSTERIZE
1910 * @see #CONTROL_EFFECT_MODE_WHITEBOARD
1911 * @see #CONTROL_EFFECT_MODE_BLACKBOARD
1912 * @see #CONTROL_EFFECT_MODE_AQUA
1913 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001914 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07001915 public static final Key<Integer> CONTROL_EFFECT_MODE =
1916 new Key<Integer>("android.control.effectMode", int.class);
1917
1918 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001919 * <p>Overall mode of 3A (auto-exposure, auto-white-balance, auto-focus) control
Zhijun Hecc28a412014-02-24 15:11:23 -08001920 * routines.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001921 * <p>This is a top-level 3A control switch. When set to OFF, all 3A control
Zhijun He5f2a47f2014-01-16 15:44:41 -08001922 * by the camera device is disabled. The application must set the fields for
Zhijun Hef3537422013-12-16 16:56:35 -08001923 * capture parameters itself.</p>
1924 * <p>When set to AUTO, the individual algorithm controls in
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001925 * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p>
Zhijun Hef3537422013-12-16 16:56:35 -08001926 * <p>When set to USE_SCENE_MODE, the individual controls in
Zhijun He5f2a47f2014-01-16 15:44:41 -08001927 * android.control.* are mostly disabled, and the camera device implements
Zhijun Hef3537422013-12-16 16:56:35 -08001928 * one of the scene mode settings (such as ACTION, SUNSET, or PARTY)
Zhijun He5f2a47f2014-01-16 15:44:41 -08001929 * as it wishes. The camera device scene mode 3A settings are provided by
Zhijun He527d5222015-05-14 15:36:04 -07001930 * {@link android.hardware.camera2.CaptureResult capture results}.</p>
Zhijun He2d5e8972014-02-07 16:13:46 -08001931 * <p>When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference
1932 * is that this frame will not be used by camera device background 3A statistics
1933 * update, as if this frame is never captured. This mode can be used in the scenario
1934 * where the application doesn't want a 3A manual control capture to affect
1935 * the subsequent auto 3A capture results.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001936 * <p><b>Possible values:</b>
1937 * <ul>
1938 * <li>{@link #CONTROL_MODE_OFF OFF}</li>
1939 * <li>{@link #CONTROL_MODE_AUTO AUTO}</li>
1940 * <li>{@link #CONTROL_MODE_USE_SCENE_MODE USE_SCENE_MODE}</li>
1941 * <li>{@link #CONTROL_MODE_OFF_KEEP_STATE OFF_KEEP_STATE}</li>
1942 * </ul></p>
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -08001943 * <p><b>Available values for this device:</b><br>
1944 * {@link CameraCharacteristics#CONTROL_AVAILABLE_MODES android.control.availableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001945 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08001946 *
1947 * @see CaptureRequest#CONTROL_AF_MODE
Yin-Chia Yehd9fc67c2015-01-30 10:47:22 -08001948 * @see CameraCharacteristics#CONTROL_AVAILABLE_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001949 * @see #CONTROL_MODE_OFF
1950 * @see #CONTROL_MODE_AUTO
1951 * @see #CONTROL_MODE_USE_SCENE_MODE
Zhijun He2d5e8972014-02-07 16:13:46 -08001952 * @see #CONTROL_MODE_OFF_KEEP_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001953 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07001954 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07001955 public static final Key<Integer> CONTROL_MODE =
1956 new Key<Integer>("android.control.mode", int.class);
1957
1958 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001959 * <p>Control for which scene mode is currently active.</p>
1960 * <p>Scene modes are custom camera modes optimized for a certain set of conditions and
1961 * capture settings.</p>
Zhijun He379af012014-05-06 11:54:54 -07001962 * <p>This is the mode that that is active when
1963 * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code>. Aside from FACE_PRIORITY,
1964 * these modes will disable {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode},
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001965 * {@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 -07001966 * <p>The interpretation and implementation of these scene modes is left
1967 * to the implementor of the camera device. Their behavior will not be
1968 * consistent across all devices, and any given device may only implement
1969 * a subset of these modes.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001970 * <p><b>Possible values:</b>
1971 * <ul>
1972 * <li>{@link #CONTROL_SCENE_MODE_DISABLED DISABLED}</li>
1973 * <li>{@link #CONTROL_SCENE_MODE_FACE_PRIORITY FACE_PRIORITY}</li>
1974 * <li>{@link #CONTROL_SCENE_MODE_ACTION ACTION}</li>
1975 * <li>{@link #CONTROL_SCENE_MODE_PORTRAIT PORTRAIT}</li>
1976 * <li>{@link #CONTROL_SCENE_MODE_LANDSCAPE LANDSCAPE}</li>
1977 * <li>{@link #CONTROL_SCENE_MODE_NIGHT NIGHT}</li>
1978 * <li>{@link #CONTROL_SCENE_MODE_NIGHT_PORTRAIT NIGHT_PORTRAIT}</li>
1979 * <li>{@link #CONTROL_SCENE_MODE_THEATRE THEATRE}</li>
1980 * <li>{@link #CONTROL_SCENE_MODE_BEACH BEACH}</li>
1981 * <li>{@link #CONTROL_SCENE_MODE_SNOW SNOW}</li>
1982 * <li>{@link #CONTROL_SCENE_MODE_SUNSET SUNSET}</li>
1983 * <li>{@link #CONTROL_SCENE_MODE_STEADYPHOTO STEADYPHOTO}</li>
1984 * <li>{@link #CONTROL_SCENE_MODE_FIREWORKS FIREWORKS}</li>
1985 * <li>{@link #CONTROL_SCENE_MODE_SPORTS SPORTS}</li>
1986 * <li>{@link #CONTROL_SCENE_MODE_PARTY PARTY}</li>
1987 * <li>{@link #CONTROL_SCENE_MODE_CANDLELIGHT CANDLELIGHT}</li>
1988 * <li>{@link #CONTROL_SCENE_MODE_BARCODE BARCODE}</li>
1989 * <li>{@link #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO HIGH_SPEED_VIDEO}</li>
Eino-Ville Talvalaf4eac122014-12-05 11:10:15 -08001990 * <li>{@link #CONTROL_SCENE_MODE_HDR HDR}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07001991 * </ul></p>
1992 * <p><b>Available values for this device:</b><br>
1993 * {@link CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES android.control.availableSceneModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07001994 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07001995 *
1996 * @see CaptureRequest#CONTROL_AE_MODE
1997 * @see CaptureRequest#CONTROL_AF_MODE
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07001998 * @see CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES
Zhijun He379af012014-05-06 11:54:54 -07001999 * @see CaptureRequest#CONTROL_AWB_MODE
2000 * @see CaptureRequest#CONTROL_MODE
2001 * @see #CONTROL_SCENE_MODE_DISABLED
2002 * @see #CONTROL_SCENE_MODE_FACE_PRIORITY
2003 * @see #CONTROL_SCENE_MODE_ACTION
2004 * @see #CONTROL_SCENE_MODE_PORTRAIT
2005 * @see #CONTROL_SCENE_MODE_LANDSCAPE
2006 * @see #CONTROL_SCENE_MODE_NIGHT
2007 * @see #CONTROL_SCENE_MODE_NIGHT_PORTRAIT
2008 * @see #CONTROL_SCENE_MODE_THEATRE
2009 * @see #CONTROL_SCENE_MODE_BEACH
2010 * @see #CONTROL_SCENE_MODE_SNOW
2011 * @see #CONTROL_SCENE_MODE_SUNSET
2012 * @see #CONTROL_SCENE_MODE_STEADYPHOTO
2013 * @see #CONTROL_SCENE_MODE_FIREWORKS
2014 * @see #CONTROL_SCENE_MODE_SPORTS
2015 * @see #CONTROL_SCENE_MODE_PARTY
2016 * @see #CONTROL_SCENE_MODE_CANDLELIGHT
2017 * @see #CONTROL_SCENE_MODE_BARCODE
Zhijun Hee0404182014-06-26 13:17:09 -07002018 * @see #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO
Eino-Ville Talvalaf4eac122014-12-05 11:10:15 -08002019 * @see #CONTROL_SCENE_MODE_HDR
Zhijun He379af012014-05-06 11:54:54 -07002020 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002021 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07002022 public static final Key<Integer> CONTROL_SCENE_MODE =
2023 new Key<Integer>("android.control.sceneMode", int.class);
2024
2025 /**
2026 * <p>Whether video stabilization is
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002027 * active.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002028 * <p>Video stabilization automatically translates and scales images from
2029 * the camera in order to stabilize motion between consecutive frames.</p>
Zhijun He379af012014-05-06 11:54:54 -07002030 * <p>If enabled, video stabilization can modify the
Zhijun He45fa43a12014-06-13 18:29:37 -07002031 * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to keep the video stream stabilized.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002032 * <p>Switching between different video stabilization modes may take several
2033 * frames to initialize, the camera device will report the current mode
2034 * in capture result metadata. For example, When "ON" mode is requested,
2035 * the video stabilization modes in the first several capture results may
2036 * still be "OFF", and it will become "ON" when the initialization is
2037 * done.</p>
2038 * <p>If a camera device supports both this mode and OIS
2039 * ({@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}), turning both modes on may
2040 * produce undesirable interaction, so it is recommended not to enable
2041 * both at the same time.</p>
2042 * <p><b>Possible values:</b>
2043 * <ul>
2044 * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_OFF OFF}</li>
2045 * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_ON ON}</li>
2046 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002047 * <p>This key is available on all devices.</p>
Zhijun He379af012014-05-06 11:54:54 -07002048 *
Zhijun He45fa43a12014-06-13 18:29:37 -07002049 * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
Zhijun He379af012014-05-06 11:54:54 -07002050 * @see CaptureRequest#SCALER_CROP_REGION
2051 * @see #CONTROL_VIDEO_STABILIZATION_MODE_OFF
2052 * @see #CONTROL_VIDEO_STABILIZATION_MODE_ON
2053 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002054 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07002055 public static final Key<Integer> CONTROL_VIDEO_STABILIZATION_MODE =
2056 new Key<Integer>("android.control.videoStabilizationMode", int.class);
2057
2058 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002059 * <p>Operation mode for edge
Zhijun Hecc28a412014-02-24 15:11:23 -08002060 * enhancement.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002061 * <p>Edge enhancement improves sharpness and details in the captured image. OFF means
2062 * no enhancement will be applied by the camera device.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08002063 * <p>FAST/HIGH_QUALITY both mean camera device determined enhancement
Zhijun He28079362013-12-17 10:35:40 -08002064 * will be applied. HIGH_QUALITY mode indicates that the
Zhijun He5f2a47f2014-01-16 15:44:41 -08002065 * camera device will use the highest-quality enhancement algorithms,
2066 * even if it slows down capture rate. FAST means the camera device will
Zhijun He28079362013-12-17 10:35:40 -08002067 * not slow down capture rate when applying edge enhancement.</p>
Zhijun He0e99c222015-01-29 15:26:05 -08002068 * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera
2069 * device will apply FAST/HIGH_QUALITY YUV-domain edge enhancement, respectively.
2070 * The camera device may adjust its internal noise reduction parameters for best
2071 * image quality based on the {@link CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR android.reprocess.effectiveExposureFactor}, if it is set.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002072 * <p><b>Possible values:</b>
2073 * <ul>
2074 * <li>{@link #EDGE_MODE_OFF OFF}</li>
2075 * <li>{@link #EDGE_MODE_FAST FAST}</li>
2076 * <li>{@link #EDGE_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
2077 * </ul></p>
2078 * <p><b>Available values for this device:</b><br>
2079 * {@link CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES android.edge.availableEdgeModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002080 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2081 * <p><b>Full capability</b> -
2082 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2083 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002084 *
2085 * @see CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002086 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He0e99c222015-01-29 15:26:05 -08002087 * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002088 * @see #EDGE_MODE_OFF
2089 * @see #EDGE_MODE_FAST
2090 * @see #EDGE_MODE_HIGH_QUALITY
2091 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002092 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002093 public static final Key<Integer> EDGE_MODE =
2094 new Key<Integer>("android.edge.mode", int.class);
2095
2096 /**
Zhijun He66d065a2014-01-16 18:18:50 -08002097 * <p>The desired mode for for the camera device's flash control.</p>
2098 * <p>This control is only effective when flash unit is available
Zhijun He153ac102014-02-03 12:25:12 -08002099 * (<code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == true</code>).</p>
Zhijun He66d065a2014-01-16 18:18:50 -08002100 * <p>When this control is used, the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} must be set to ON or OFF.
2101 * Otherwise, the camera device auto-exposure related flash control (ON_AUTO_FLASH,
2102 * ON_ALWAYS_FLASH, or ON_AUTO_FLASH_REDEYE) will override this control.</p>
2103 * <p>When set to OFF, the camera device will not fire flash for this capture.</p>
2104 * <p>When set to SINGLE, the camera device will fire flash regardless of the camera
2105 * device's auto-exposure routine's result. When used in still capture case, this
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002106 * control should be used along with auto-exposure (AE) precapture metering sequence
Zhijun He66d065a2014-01-16 18:18:50 -08002107 * ({@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}), otherwise, the image may be incorrectly exposed.</p>
2108 * <p>When set to TORCH, the flash will be on continuously. This mode can be used
2109 * for use cases such as preview, auto-focus assist, still capture, or video recording.</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002110 * <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 -07002111 * <p><b>Possible values:</b>
2112 * <ul>
2113 * <li>{@link #FLASH_MODE_OFF OFF}</li>
2114 * <li>{@link #FLASH_MODE_SINGLE SINGLE}</li>
2115 * <li>{@link #FLASH_MODE_TORCH TORCH}</li>
2116 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002117 * <p>This key is available on all devices.</p>
Zhijun He66d065a2014-01-16 18:18:50 -08002118 *
2119 * @see CaptureRequest#CONTROL_AE_MODE
2120 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
2121 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
Zhijun Heca1b73a2014-02-03 12:39:53 -08002122 * @see CaptureResult#FLASH_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002123 * @see #FLASH_MODE_OFF
2124 * @see #FLASH_MODE_SINGLE
2125 * @see #FLASH_MODE_TORCH
2126 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002127 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002128 public static final Key<Integer> FLASH_MODE =
2129 new Key<Integer>("android.flash.mode", int.class);
2130
2131 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002132 * <p>Current state of the flash
Zhijun Heca1b73a2014-02-03 12:39:53 -08002133 * unit.</p>
2134 * <p>When the camera device doesn't have flash unit
2135 * (i.e. <code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == false</code>), this state will always be UNAVAILABLE.
2136 * Other states indicate the current flash status.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002137 * <p>In certain conditions, this will be available on LEGACY devices:</p>
2138 * <ul>
2139 * <li>Flash-less cameras always return UNAVAILABLE.</li>
2140 * <li>Using {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>==</code> ON_ALWAYS_FLASH
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002141 * will always return FIRED.</li>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002142 * <li>Using {@link CaptureRequest#FLASH_MODE android.flash.mode} <code>==</code> TORCH
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002143 * will always return FIRED.</li>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002144 * </ul>
2145 * <p>In all other conditions the state will not be available on
2146 * LEGACY devices (i.e. it will be <code>null</code>).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002147 * <p><b>Possible values:</b>
2148 * <ul>
2149 * <li>{@link #FLASH_STATE_UNAVAILABLE UNAVAILABLE}</li>
2150 * <li>{@link #FLASH_STATE_CHARGING CHARGING}</li>
2151 * <li>{@link #FLASH_STATE_READY READY}</li>
2152 * <li>{@link #FLASH_STATE_FIRED FIRED}</li>
2153 * <li>{@link #FLASH_STATE_PARTIAL PARTIAL}</li>
2154 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002155 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2156 * <p><b>Limited capability</b> -
2157 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2158 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002159 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002160 * @see CaptureRequest#CONTROL_AE_MODE
Zhijun Heca1b73a2014-02-03 12:39:53 -08002161 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002162 * @see CaptureRequest#FLASH_MODE
2163 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002164 * @see #FLASH_STATE_UNAVAILABLE
2165 * @see #FLASH_STATE_CHARGING
2166 * @see #FLASH_STATE_READY
2167 * @see #FLASH_STATE_FIRED
Zhijun He8dda7272014-03-25 13:49:30 -07002168 * @see #FLASH_STATE_PARTIAL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002169 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002170 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002171 public static final Key<Integer> FLASH_STATE =
2172 new Key<Integer>("android.flash.state", int.class);
2173
2174 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002175 * <p>Operational mode for hot pixel correction.</p>
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002176 * <p>Hotpixel correction interpolates out, or otherwise removes, pixels
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002177 * that do not accurately measure the incoming light (i.e. pixels that
2178 * are stuck at an arbitrary value or are oversensitive).</p>
2179 * <p><b>Possible values:</b>
2180 * <ul>
2181 * <li>{@link #HOT_PIXEL_MODE_OFF OFF}</li>
2182 * <li>{@link #HOT_PIXEL_MODE_FAST FAST}</li>
2183 * <li>{@link #HOT_PIXEL_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
2184 * </ul></p>
2185 * <p><b>Available values for this device:</b><br>
2186 * {@link CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES android.hotPixel.availableHotPixelModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002187 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08002188 *
2189 * @see CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002190 * @see #HOT_PIXEL_MODE_OFF
2191 * @see #HOT_PIXEL_MODE_FAST
2192 * @see #HOT_PIXEL_MODE_HIGH_QUALITY
2193 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002194 @PublicKey
Ruben Brunkeba1b3a2014-02-07 18:23:50 -08002195 public static final Key<Integer> HOT_PIXEL_MODE =
2196 new Key<Integer>("android.hotPixel.mode", int.class);
2197
2198 /**
Ruben Brunk57493682014-05-27 18:58:08 -07002199 * <p>A location object to use when generating image GPS metadata.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002200 * <p>Setting a location object in a request will include the GPS coordinates of the location
2201 * into any JPEG images captured based on the request. These coordinates can then be
2202 * viewed by anyone who receives the JPEG image.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002203 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002204 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002205 @PublicKey
2206 @SyntheticKey
Ruben Brunk57493682014-05-27 18:58:08 -07002207 public static final Key<android.location.Location> JPEG_GPS_LOCATION =
2208 new Key<android.location.Location>("android.jpeg.gpsLocation", android.location.Location.class);
2209
2210 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002211 * <p>GPS coordinates to include in output JPEG
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002212 * EXIF.</p>
2213 * <p><b>Range of valid values:</b><br>
2214 * (-180 - 180], [-90,90], [-inf, inf]</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002215 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002216 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002217 */
2218 public static final Key<double[]> JPEG_GPS_COORDINATES =
2219 new Key<double[]>("android.jpeg.gpsCoordinates", double[].class);
2220
2221 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002222 * <p>32 characters describing GPS algorithm to
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002223 * include in EXIF.</p>
2224 * <p><b>Units</b>: UTF-8 null-terminated string</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002225 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002226 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002227 */
2228 public static final Key<String> JPEG_GPS_PROCESSING_METHOD =
2229 new Key<String>("android.jpeg.gpsProcessingMethod", String.class);
2230
2231 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002232 * <p>Time GPS fix was made to include in
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002233 * EXIF.</p>
2234 * <p><b>Units</b>: UTC in seconds since January 1, 1970</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002235 * <p>This key is available on all devices.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07002236 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002237 */
2238 public static final Key<Long> JPEG_GPS_TIMESTAMP =
2239 new Key<Long>("android.jpeg.gpsTimestamp", long.class);
2240
2241 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002242 * <p>The orientation for a JPEG image.</p>
2243 * <p>The clockwise rotation angle in degrees, relative to the orientation
2244 * to the camera, that the JPEG picture needs to be rotated by, to be viewed
2245 * upright.</p>
2246 * <p>Camera devices may either encode this value into the JPEG EXIF header, or
Yin-Chia Yehd49ebcc2015-03-27 13:54:04 -07002247 * rotate the image data to match this orientation. When the image data is rotated,
2248 * the thumbnail data will also be rotated.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002249 * <p>Note that this orientation is relative to the orientation of the camera sensor, given
2250 * by {@link CameraCharacteristics#SENSOR_ORIENTATION android.sensor.orientation}.</p>
2251 * <p>To translate from the device orientation given by the Android sensor APIs, the following
2252 * sample code may be used:</p>
2253 * <pre><code>private int getJpegOrientation(CameraCharacteristics c, int deviceOrientation) {
2254 * if (deviceOrientation == android.view.OrientationEventListener.ORIENTATION_UNKNOWN) return 0;
2255 * int sensorOrientation = c.get(CameraCharacteristics.SENSOR_ORIENTATION);
2256 *
2257 * // Round device orientation to a multiple of 90
2258 * deviceOrientation = (deviceOrientation + 45) / 90 * 90;
2259 *
2260 * // Reverse device orientation for front-facing cameras
2261 * boolean facingFront = c.get(CameraCharacteristics.LENS_FACING) == CameraCharacteristics.LENS_FACING_FRONT;
2262 * if (facingFront) deviceOrientation = -deviceOrientation;
2263 *
2264 * // Calculate desired JPEG orientation relative to camera orientation to make
2265 * // the image upright relative to the device orientation
2266 * int jpegOrientation = (sensorOrientation + deviceOrientation + 360) % 360;
2267 *
2268 * return jpegOrientation;
2269 * }
2270 * </code></pre>
2271 * <p><b>Units</b>: Degrees in multiples of 90</p>
2272 * <p><b>Range of valid values:</b><br>
2273 * 0, 90, 180, 270</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002274 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002275 *
2276 * @see CameraCharacteristics#SENSOR_ORIENTATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002277 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002278 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002279 public static final Key<Integer> JPEG_ORIENTATION =
2280 new Key<Integer>("android.jpeg.orientation", int.class);
2281
2282 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002283 * <p>Compression quality of the final JPEG
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002284 * image.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002285 * <p>85-95 is typical usage range.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002286 * <p><b>Range of valid values:</b><br>
2287 * 1-100; larger is higher quality</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002288 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002289 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002290 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002291 public static final Key<Byte> JPEG_QUALITY =
2292 new Key<Byte>("android.jpeg.quality", byte.class);
2293
2294 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002295 * <p>Compression quality of JPEG
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002296 * thumbnail.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002297 * <p><b>Range of valid values:</b><br>
2298 * 1-100; larger is higher quality</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002299 * <p>This key is available on all devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002300 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002301 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002302 public static final Key<Byte> JPEG_THUMBNAIL_QUALITY =
2303 new Key<Byte>("android.jpeg.thumbnailQuality", byte.class);
2304
2305 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002306 * <p>Resolution of embedded JPEG thumbnail.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08002307 * <p>When set to (0, 0) value, the JPEG EXIF will not contain thumbnail,
2308 * but the captured JPEG will still be a valid image.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002309 * <p>For best results, when issuing a request for a JPEG image, the thumbnail size selected
2310 * should have the same aspect ratio as the main JPEG output.</p>
Zhijun He50f72432014-05-28 13:52:04 -07002311 * <p>If the thumbnail image aspect ratio differs from the JPEG primary image aspect
2312 * ratio, the camera device creates the thumbnail by cropping it from the primary image.
2313 * For example, if the primary image has 4:3 aspect ratio, the thumbnail image has
2314 * 16:9 aspect ratio, the primary image will be cropped vertically (letterbox) to
2315 * generate the thumbnail image. The thumbnail image will always have a smaller Field
2316 * Of View (FOV) than the primary image when aspect ratios differ.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002317 * <p><b>Range of valid values:</b><br>
2318 * {@link CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES android.jpeg.availableThumbnailSizes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002319 * <p>This key is available on all devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002320 *
2321 * @see CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002322 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002323 @PublicKey
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07002324 public static final Key<android.util.Size> JPEG_THUMBNAIL_SIZE =
2325 new Key<android.util.Size>("android.jpeg.thumbnailSize", android.util.Size.class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002326
2327 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002328 * <p>The desired lens aperture size, as a ratio of lens focal length to the
2329 * effective aperture diameter.</p>
2330 * <p>Setting this value is only supported on the camera devices that have a variable
2331 * aperture lens.</p>
Zhijun Hefb46c642014-01-14 17:57:23 -08002332 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF,
2333 * this can be set along with {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002334 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}
Zhijun Hefb46c642014-01-14 17:57:23 -08002335 * to achieve manual exposure control.</p>
2336 * <p>The requested aperture value may take several frames to reach the
2337 * requested value; the camera device will report the current (intermediate)
Zhijun Heca1b73a2014-02-03 12:39:53 -08002338 * aperture size in capture result metadata while the aperture is changing.
2339 * 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 -08002340 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of
2341 * the ON modes, this will be overridden by the camera device
2342 * auto-exposure algorithm, the overridden values are then provided
2343 * back to the user in the corresponding result.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002344 * <p><b>Units</b>: The f-number (f/N)</p>
2345 * <p><b>Range of valid values:</b><br>
2346 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002347 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2348 * <p><b>Full capability</b> -
2349 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2350 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Hefb46c642014-01-14 17:57:23 -08002351 *
Zhijun He399f05d2014-01-15 11:31:30 -08002352 * @see CaptureRequest#CONTROL_AE_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002353 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002354 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
Zhijun Heca1b73a2014-02-03 12:39:53 -08002355 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002356 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002357 * @see CaptureRequest#SENSOR_FRAME_DURATION
Eino-Ville Talvala265b34c2014-01-16 16:18:52 -08002358 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002359 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002360 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002361 public static final Key<Float> LENS_APERTURE =
2362 new Key<Float>("android.lens.aperture", float.class);
2363
2364 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002365 * <p>The desired setting for the lens neutral density filter(s).</p>
2366 * <p>This control will not be supported on most camera devices.</p>
Ruben Brunk855bae42014-01-17 10:30:32 -08002367 * <p>Lens filters are typically used to lower the amount of light the
2368 * sensor is exposed to (measured in steps of EV). As used here, an EV
2369 * step is the standard logarithmic representation, which are
2370 * non-negative, and inversely proportional to the amount of light
2371 * hitting the sensor. For example, setting this to 0 would result
2372 * in no reduction of the incoming light, and setting this to 2 would
2373 * mean that the filter is set to reduce incoming light by two stops
2374 * (allowing 1/4 of the prior amount of light to the sensor).</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002375 * <p>It may take several frames before the lens filter density changes
2376 * to the requested value. While the filter density is still changing,
2377 * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002378 * <p><b>Units</b>: Exposure Value (EV)</p>
2379 * <p><b>Range of valid values:</b><br>
2380 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002381 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2382 * <p><b>Full capability</b> -
2383 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2384 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk855bae42014-01-17 10:30:32 -08002385 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002386 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk855bae42014-01-17 10:30:32 -08002387 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
Zhijun Heca1b73a2014-02-03 12:39:53 -08002388 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002389 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002390 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002391 public static final Key<Float> LENS_FILTER_DENSITY =
2392 new Key<Float>("android.lens.filterDensity", float.class);
2393
2394 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002395 * <p>The desired lens focal length; used for optical zoom.</p>
Ruben Brunka20f4c22014-01-17 15:21:13 -08002396 * <p>This setting controls the physical focal length of the camera
2397 * device's lens. Changing the focal length changes the field of
2398 * view of the camera device, and is usually used for optical zoom.</p>
2399 * <p>Like {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, this
2400 * setting won't be applied instantaneously, and it may take several
Zhijun Heca1b73a2014-02-03 12:39:53 -08002401 * frames before the lens can change to the requested focal length.
Ruben Brunka20f4c22014-01-17 15:21:13 -08002402 * While the focal length is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will
2403 * be set to MOVING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002404 * <p>Optical zoom will not be supported on most devices.</p>
2405 * <p><b>Units</b>: Millimeters</p>
2406 * <p><b>Range of valid values:</b><br>
2407 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002408 * <p>This key is available on all devices.</p>
Ruben Brunka20f4c22014-01-17 15:21:13 -08002409 *
2410 * @see CaptureRequest#LENS_APERTURE
2411 * @see CaptureRequest#LENS_FOCUS_DISTANCE
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002412 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS
Ruben Brunka20f4c22014-01-17 15:21:13 -08002413 * @see CaptureResult#LENS_STATE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002414 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002415 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002416 public static final Key<Float> LENS_FOCAL_LENGTH =
2417 new Key<Float>("android.lens.focalLength", float.class);
2418
2419 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002420 * <p>Desired distance to plane of sharpest focus,
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002421 * measured from frontmost surface of the lens.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002422 * <p>Should be zero for fixed-focus cameras</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002423 * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p>
2424 * <p><b>Range of valid values:</b><br>
2425 * &gt;= 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002426 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2427 * <p><b>Full capability</b> -
2428 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2429 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2430 *
2431 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002432 * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002433 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002434 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002435 public static final Key<Float> LENS_FOCUS_DISTANCE =
2436 new Key<Float>("android.lens.focusDistance", float.class);
2437
2438 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002439 * <p>The range of scene distances that are in
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002440 * sharp focus (depth of field).</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002441 * <p>If variable focus not supported, can still report
2442 * fixed depth of field range</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002443 * <p><b>Units</b>: A pair of focus distances in diopters: (near,
2444 * far); see {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details.</p>
2445 * <p><b>Range of valid values:</b><br>
2446 * &gt;=0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002447 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2448 * <p><b>Limited capability</b> -
2449 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2450 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2451 *
2452 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002453 * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002454 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002455 @PublicKey
Igor Murashkin57438682014-05-30 10:49:00 -07002456 public static final Key<android.util.Pair<Float,Float>> LENS_FOCUS_RANGE =
2457 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 -07002458
2459 /**
Ruben Brunk00849b32014-01-17 18:30:23 -08002460 * <p>Sets whether the camera device uses optical image stabilization (OIS)
2461 * when capturing images.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002462 * <p>OIS is used to compensate for motion blur due to small
2463 * movements of the camera during capture. Unlike digital image
2464 * stabilization ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), OIS
2465 * makes use of mechanical elements to stabilize the camera
2466 * sensor, and thus allows for longer exposure times before
2467 * camera shake becomes apparent.</p>
Zhijun He45fa43a12014-06-13 18:29:37 -07002468 * <p>Switching between different optical stabilization modes may take several
2469 * frames to initialize, the camera device will report the current mode in
2470 * capture result metadata. For example, When "ON" mode is requested, the
2471 * optical stabilization modes in the first several capture results may still
2472 * be "OFF", and it will become "ON" when the initialization is done.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002473 * <p>If a camera device supports both OIS and digital image stabilization
2474 * ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), turning both modes on may produce undesirable
2475 * interaction, so it is recommended not to enable both at the same time.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002476 * <p>Not all devices will support OIS; see
2477 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization} for
2478 * available controls.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002479 * <p><b>Possible values:</b>
2480 * <ul>
2481 * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_OFF OFF}</li>
2482 * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_ON ON}</li>
2483 * </ul></p>
2484 * <p><b>Available values for this device:</b><br>
2485 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002486 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2487 * <p><b>Limited capability</b> -
2488 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2489 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002490 *
2491 * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002492 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002493 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002494 * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF
2495 * @see #LENS_OPTICAL_STABILIZATION_MODE_ON
2496 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002497 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002498 public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE =
2499 new Key<Integer>("android.lens.opticalStabilizationMode", int.class);
2500
2501 /**
Zhijun Heca1b73a2014-02-03 12:39:53 -08002502 * <p>Current lens status.</p>
2503 * <p>For lens parameters {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}, {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance},
2504 * {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, when changes are requested,
2505 * they may take several frames to reach the requested values. This state indicates
2506 * the current status of the lens parameters.</p>
2507 * <p>When the state is STATIONARY, the lens parameters are not changing. This could be
2508 * either because the parameters are all fixed, or because the lens has had enough
2509 * time to reach the most recently-requested values.
2510 * If all these lens parameters are not changable for a camera device, as listed below:</p>
2511 * <ul>
2512 * <li>Fixed focus (<code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} == 0</code>), which means
2513 * {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} parameter will always be 0.</li>
2514 * <li>Fixed focal length ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths} contains single value),
2515 * which means the optical zoom is not supported.</li>
2516 * <li>No ND filter ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities} contains only 0).</li>
2517 * <li>Fixed aperture ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures} contains single value).</li>
2518 * </ul>
2519 * <p>Then this state will always be STATIONARY.</p>
2520 * <p>When the state is MOVING, it indicates that at least one of the lens parameters
2521 * is changing.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002522 * <p><b>Possible values:</b>
2523 * <ul>
2524 * <li>{@link #LENS_STATE_STATIONARY STATIONARY}</li>
2525 * <li>{@link #LENS_STATE_MOVING MOVING}</li>
2526 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002527 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2528 * <p><b>Limited capability</b> -
2529 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2530 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heca1b73a2014-02-03 12:39:53 -08002531 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002532 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun Heca1b73a2014-02-03 12:39:53 -08002533 * @see CaptureRequest#LENS_APERTURE
2534 * @see CaptureRequest#LENS_FILTER_DENSITY
2535 * @see CaptureRequest#LENS_FOCAL_LENGTH
2536 * @see CaptureRequest#LENS_FOCUS_DISTANCE
2537 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
2538 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
2539 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS
2540 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002541 * @see #LENS_STATE_STATIONARY
Igor Murashkin9ea4ae62013-09-11 21:40:11 -07002542 * @see #LENS_STATE_MOVING
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002543 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002544 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002545 public static final Key<Integer> LENS_STATE =
2546 new Key<Integer>("android.lens.state", int.class);
2547
2548 /**
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002549 * <p>The orientation of the camera relative to the sensor
2550 * coordinate system.</p>
2551 * <p>The four coefficients that describe the quarternion
2552 * rotation from the Android sensor coordinate system to a
2553 * camera-aligned coordinate system where the X-axis is
2554 * aligned with the long side of the image sensor, the Y-axis
2555 * is aligned with the short side of the image sensor, and
2556 * the Z-axis is aligned with the optical axis of the sensor.</p>
2557 * <p>To convert from the quarternion coefficients <code>(x,y,z,w)</code>
2558 * to the axis of rotation <code>(a_x, a_y, a_z)</code> and rotation
2559 * amount <code>theta</code>, the following formulas can be used:</p>
2560 * <pre><code> theta = 2 * acos(w)
2561 * a_x = x / sin(theta/2)
2562 * a_y = y / sin(theta/2)
2563 * a_z = z / sin(theta/2)
2564 * </code></pre>
2565 * <p>To create a 3x3 rotation matrix that applies the rotation
2566 * defined by this quarternion, the following matrix can be
2567 * used:</p>
2568 * <pre><code>R = [ 1 - 2y^2 - 2z^2, 2xy - 2zw, 2xz + 2yw,
2569 * 2xy + 2zw, 1 - 2x^2 - 2z^2, 2yz - 2xw,
2570 * 2xz - 2yw, 2yz + 2xw, 1 - 2x^2 - 2y^2 ]
2571 * </code></pre>
2572 * <p>This matrix can then be used to apply the rotation to a
2573 * column vector point with</p>
2574 * <p><code>p' = Rp</code></p>
2575 * <p>where <code>p</code> is in the device sensor coordinate system, and
2576 * <code>p'</code> is in the camera-oriented coordinate system.</p>
2577 * <p><b>Units</b>:
2578 * Quarternion coefficients</p>
2579 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2580 */
2581 @PublicKey
2582 public static final Key<float[]> LENS_POSE_ROTATION =
2583 new Key<float[]>("android.lens.poseRotation", float[].class);
2584
2585 /**
2586 * <p>Position of the camera optical center.</p>
Eino-Ville Talvalad3dbfb32015-05-29 17:17:04 -07002587 * <p>The position of the camera device's lens optical center,
2588 * as a three-dimensional vector <code>(x,y,z)</code>, relative to the
2589 * optical center of the largest camera device facing in the
2590 * same direction as this camera, in the {@link android.hardware.SensorEvent Android sensor coordinate
2591 * axes}. Note that only the axis definitions are shared with
2592 * the sensor coordinate system, but not the origin.</p>
2593 * <p>If this device is the largest or only camera device with a
2594 * given facing, then this position will be <code>(0, 0, 0)</code>; a
2595 * camera device with a lens optical center located 3 cm from
2596 * the main sensor along the +X axis (to the right from the
2597 * user's perspective) will report <code>(0.03, 0, 0)</code>.</p>
2598 * <p>To transform a pixel coordinates between two cameras
2599 * facing the same direction, first the source camera
2600 * android.lens.radialDistortion must be corrected for. Then
2601 * the source camera android.lens.intrinsicCalibration needs
2602 * to be applied, followed by the {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation}
2603 * of the source camera, the translation of the source camera
2604 * relative to the destination camera, the
2605 * {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} of the destination camera, and
2606 * finally the inverse of android.lens.intrinsicCalibration
2607 * of the destination camera. This obtains a
2608 * radial-distortion-free coordinate in the destination
2609 * camera pixel coordinates.</p>
2610 * <p>To compare this against a real image from the destination
2611 * camera, the destination camera image then needs to be
2612 * corrected for radial distortion before comparison or
2613 * sampling.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002614 * <p><b>Units</b>: Meters</p>
2615 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2616 *
2617 * @see CameraCharacteristics#LENS_POSE_ROTATION
2618 */
2619 @PublicKey
2620 public static final Key<float[]> LENS_POSE_TRANSLATION =
2621 new Key<float[]>("android.lens.poseTranslation", float[].class);
2622
2623 /**
2624 * <p>The parameters for this camera device's intrinsic
2625 * calibration.</p>
2626 * <p>The five calibration parameters that describe the
2627 * transform from camera-centric 3D coordinates to sensor
2628 * pixel coordinates:</p>
2629 * <pre><code>[f_x, f_y, c_x, c_y, s]
2630 * </code></pre>
2631 * <p>Where <code>f_x</code> and <code>f_y</code> are the horizontal and vertical
2632 * focal lengths, <code>[c_x, c_y]</code> is the position of the optical
2633 * axis, and <code>s</code> is a skew parameter for the sensor plane not
2634 * being aligned with the lens plane.</p>
2635 * <p>These are typically used within a transformation matrix K:</p>
2636 * <pre><code>K = [ f_x, s, c_x,
2637 * 0, f_y, c_y,
2638 * 0 0, 1 ]
2639 * </code></pre>
2640 * <p>which can then be combined with the camera pose rotation
2641 * <code>R</code> and translation <code>t</code> ({@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} and
2642 * {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation}, respective) to calculate the
2643 * complete transform from world coordinates to pixel
2644 * coordinates:</p>
2645 * <pre><code>P = [ K 0 * [ R t
2646 * 0 1 ] 0 1 ]
2647 * </code></pre>
2648 * <p>and with <code>p_w</code> being a point in the world coordinate system
2649 * and <code>p_s</code> being a point in the camera active pixel array
2650 * coordinate system, and with the mapping including the
2651 * homogeneous division by z:</p>
2652 * <pre><code> p_h = (x_h, y_h, z_h) = P p_w
2653 * p_s = p_h / z_h
2654 * </code></pre>
2655 * <p>so <code>[x_s, y_s]</code> is the pixel coordinates of the world
2656 * point, <code>z_s = 1</code>, and <code>w_s</code> is a measurement of disparity
2657 * (depth) in pixel coordinates.</p>
2658 * <p><b>Units</b>:
Eino-Ville Talvala0b7b03b2015-04-13 17:29:52 -07002659 * Pixels in the {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} coordinate
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002660 * system.</p>
2661 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2662 *
2663 * @see CameraCharacteristics#LENS_POSE_ROTATION
2664 * @see CameraCharacteristics#LENS_POSE_TRANSLATION
Eino-Ville Talvala0b7b03b2015-04-13 17:29:52 -07002665 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002666 */
2667 @PublicKey
2668 public static final Key<float[]> LENS_INTRINSIC_CALIBRATION =
2669 new Key<float[]>("android.lens.intrinsicCalibration", float[].class);
2670
2671 /**
2672 * <p>The correction coefficients to correct for this camera device's
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07002673 * radial and tangential lens distortion.</p>
Ruben Brunk02cd8cb2015-06-15 15:33:09 -07002674 * <p>Four radial distortion coefficients <code>[kappa_0, kappa_1, kappa_2,
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07002675 * kappa_3]</code> and two tangential distortion coefficients
2676 * <code>[kappa_4, kappa_5]</code> that can be used to correct the
2677 * lens's geometric distortion with the mapping equations:</p>
Ruben Brunk02cd8cb2015-06-15 15:33:09 -07002678 * <pre><code> x_c = x_i * ( kappa_0 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) +
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07002679 * kappa_4 * (2 * x_i * y_i) + kappa_5 * ( r^2 + 2 * x_i^2 )
Ruben Brunk02cd8cb2015-06-15 15:33:09 -07002680 * y_c = y_i * ( kappa_0 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) +
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07002681 * kappa_5 * (2 * x_i * y_i) + kappa_4 * ( r^2 + 2 * y_i^2 )
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002682 * </code></pre>
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07002683 * <p>Here, <code>[x_c, y_c]</code> are the coordinates to sample in the
2684 * input image that correspond to the pixel values in the
2685 * corrected image at the coordinate <code>[x_i, y_i]</code>:</p>
2686 * <pre><code> correctedImage(x_i, y_i) = sample_at(x_c, y_c, inputImage)
2687 * </code></pre>
2688 * <p>The pixel coordinates are defined in a normalized
2689 * coordinate system related to the
2690 * android.lens.intrinsicCalibration calibration fields.
2691 * Both <code>[x_i, y_i]</code> and <code>[x_c, y_c]</code> have <code>(0,0)</code> at the
2692 * lens optical center <code>[c_x, c_y]</code>. The maximum magnitudes
2693 * of both x and y coordinates are normalized to be 1 at the
2694 * edge further from the optical center, so the range
2695 * for both dimensions is <code>-1 &lt;= x &lt;= 1</code>.</p>
2696 * <p>Finally, <code>r</code> represents the radial distance from the
2697 * optical center, <code>r^2 = x_i^2 + y_i^2</code>, and its magnitude
2698 * is therefore no larger than <code>|r| &lt;= sqrt(2)</code>.</p>
2699 * <p>The distortion model used is the Brown-Conrady model.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002700 * <p><b>Units</b>:
Eino-Ville Talvala66c73ba2015-05-29 16:11:56 -07002701 * Unitless coefficients.</p>
Eino-Ville Talvala046a9782015-04-08 20:05:56 +00002702 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2703 */
2704 @PublicKey
2705 public static final Key<float[]> LENS_RADIAL_DISTORTION =
2706 new Key<float[]>("android.lens.radialDistortion", float[].class);
2707
2708 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002709 * <p>Mode of operation for the noise reduction algorithm.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002710 * <p>The noise reduction algorithm attempts to improve image quality by removing
Zhijun He0e99c222015-01-29 15:26:05 -08002711 * excessive noise added by the capture process, especially in dark conditions.</p>
2712 * <p>OFF means no noise reduction will be applied by the camera device, for both raw and
2713 * YUV domain.</p>
2714 * <p>MINIMAL means that only sensor raw domain basic noise reduction is enabled ,to remove
2715 * demosaicing or other processing artifacts. For YUV_REPROCESSING, MINIMAL is same as OFF.
2716 * This mode is optional, may not be support by all devices. The application should check
2717 * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes} before using it.</p>
Zhijun He5f2a47f2014-01-16 15:44:41 -08002718 * <p>FAST/HIGH_QUALITY both mean camera device determined noise filtering
2719 * will be applied. HIGH_QUALITY mode indicates that the camera device
2720 * will use the highest-quality noise filtering algorithms,
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07002721 * even if it slows down capture rate. FAST means the camera device will not
Zhijun He28079362013-12-17 10:35:40 -08002722 * slow down capture rate when applying noise filtering.</p>
Zhijun He0e99c222015-01-29 15:26:05 -08002723 * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera device
2724 * will apply FAST/HIGH_QUALITY YUV domain noise reduction, respectively. The camera device
2725 * may adjust the noise reduction parameters for best image quality based on the
2726 * {@link CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR android.reprocess.effectiveExposureFactor} if it is set.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002727 * <p><b>Possible values:</b>
2728 * <ul>
2729 * <li>{@link #NOISE_REDUCTION_MODE_OFF OFF}</li>
2730 * <li>{@link #NOISE_REDUCTION_MODE_FAST FAST}</li>
2731 * <li>{@link #NOISE_REDUCTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
Zhijun He0e99c222015-01-29 15:26:05 -08002732 * <li>{@link #NOISE_REDUCTION_MODE_MINIMAL MINIMAL}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002733 * </ul></p>
2734 * <p><b>Available values for this device:</b><br>
2735 * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002736 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2737 * <p><b>Full capability</b> -
2738 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2739 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002740 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002741 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -08002742 * @see CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES
Zhijun He0e99c222015-01-29 15:26:05 -08002743 * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002744 * @see #NOISE_REDUCTION_MODE_OFF
2745 * @see #NOISE_REDUCTION_MODE_FAST
2746 * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY
Zhijun He0e99c222015-01-29 15:26:05 -08002747 * @see #NOISE_REDUCTION_MODE_MINIMAL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002748 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002749 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002750 public static final Key<Integer> NOISE_REDUCTION_MODE =
2751 new Key<Integer>("android.noiseReduction.mode", int.class);
2752
2753 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002754 * <p>Whether a result given to the framework is the
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002755 * final one for the capture, or only a partial that contains a
2756 * subset of the full set of dynamic metadata
Igor Murashkinace5bf02013-12-10 17:36:40 -08002757 * values.</p>
2758 * <p>The entries in the result metadata buffers for a
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002759 * single capture may not overlap, except for this entry. The
2760 * FINAL buffers must retain FIFO ordering relative to the
2761 * requests that generate them, so the FINAL buffer for frame 3 must
2762 * always be sent to the framework after the FINAL buffer for frame 2, and
2763 * before the FINAL buffer for frame 4. PARTIAL buffers may be returned
2764 * in any order relative to other frames, but all PARTIAL buffers for a given
2765 * capture must arrive before the FINAL buffer for that capture. This entry may
Zhijun Hecc28a412014-02-24 15:11:23 -08002766 * only be used by the camera device if quirks.usePartialResult is set to 1.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002767 * <p><b>Range of valid values:</b><br>
2768 * Optional. Default value is FINAL.</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08002769 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07002770 * @deprecated
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002771 * @hide
2772 */
Igor Murashkin9c595172014-05-12 13:56:20 -07002773 @Deprecated
Eino-Ville Talvala7a313102013-11-07 14:45:06 -08002774 public static final Key<Boolean> QUIRKS_PARTIAL_RESULT =
2775 new Key<Boolean>("android.quirks.partialResult", boolean.class);
2776
2777 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002778 * <p>A frame counter set by the framework. This value monotonically
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -07002779 * increases with every new result (that is, each new result has a unique
Igor Murashkinace5bf02013-12-10 17:36:40 -08002780 * frameCount value).</p>
2781 * <p>Reset on release()</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002782 * <p><b>Units</b>: count of frames</p>
2783 * <p><b>Range of valid values:</b><br>
2784 * &gt; 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002785 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkinbdf366c2014-07-25 16:54:20 -07002786 * @deprecated
2787 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002788 */
Igor Murashkinbdf366c2014-07-25 16:54:20 -07002789 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002790 public static final Key<Integer> REQUEST_FRAME_COUNT =
2791 new Key<Integer>("android.request.frameCount", int.class);
2792
2793 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002794 * <p>An application-specified ID for the current
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002795 * request. Must be maintained unchanged in output
Igor Murashkinace5bf02013-12-10 17:36:40 -08002796 * frame</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002797 * <p><b>Units</b>: arbitrary integer assigned by application</p>
2798 * <p><b>Range of valid values:</b><br>
2799 * Any int</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002800 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002801 * @hide
2802 */
2803 public static final Key<Integer> REQUEST_ID =
2804 new Key<Integer>("android.request.id", int.class);
2805
2806 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08002807 * <p>Specifies the number of pipeline stages the frame went
2808 * through from when it was exposed to when the final completed result
2809 * was available to the framework.</p>
2810 * <p>Depending on what settings are used in the request, and
2811 * what streams are configured, the data may undergo less processing,
2812 * and some pipeline stages skipped.</p>
2813 * <p>See {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} for more details.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002814 * <p><b>Range of valid values:</b><br>
2815 * &lt;= {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002816 * <p>This key is available on all devices.</p>
Igor Murashkinc127f052014-01-17 18:06:02 -08002817 *
2818 * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
2819 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002820 @PublicKey
Igor Murashkinc127f052014-01-17 18:06:02 -08002821 public static final Key<Byte> REQUEST_PIPELINE_DEPTH =
2822 new Key<Byte>("android.request.pipelineDepth", byte.class);
2823
2824 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002825 * <p>The desired region of the sensor to read out for this capture.</p>
2826 * <p>This control can be used to implement digital zoom.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002827 * <p>The crop region coordinate system is based off
2828 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being the
2829 * top-left corner of the sensor active array.</p>
2830 * <p>Output streams use this rectangle to produce their output,
2831 * cropping to a smaller region if necessary to maintain the
2832 * stream's aspect ratio, then scaling the sensor input to
2833 * match the output's configured resolution.</p>
2834 * <p>The crop region is applied after the RAW to other color
2835 * space (e.g. YUV) conversion. Since raw streams
2836 * (e.g. RAW16) don't have the conversion stage, they are not
2837 * croppable. The crop region will be ignored by raw streams.</p>
Zhijun He9e6d1882014-05-22 16:47:35 -07002838 * <p>For non-raw streams, any additional per-stream cropping will
2839 * be done to maximize the final pixel area of the stream.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08002840 * <p>For example, if the crop region is set to a 4:3 aspect
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002841 * ratio, then 4:3 streams will use the exact crop
2842 * region. 16:9 streams will further crop vertically
Igor Murashkinace5bf02013-12-10 17:36:40 -08002843 * (letterbox).</p>
2844 * <p>Conversely, if the crop region is set to a 16:9, then 4:3
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002845 * outputs will crop horizontally (pillarbox), and 16:9
2846 * streams will match exactly. These additional crops will
Igor Murashkinace5bf02013-12-10 17:36:40 -08002847 * be centered within the crop region.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002848 * <p>The width and height of the crop region cannot
2849 * be set to be smaller than
2850 * <code>floor( activeArraySize.width / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code> and
2851 * <code>floor( activeArraySize.height / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code>, respectively.</p>
2852 * <p>The camera device may adjust the crop region to account
2853 * for rounding and other hardware requirements; the final
2854 * crop region used will be included in the output capture
2855 * result.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002856 * <p><b>Units</b>: Pixel coordinates relative to
2857 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002858 * <p>This key is available on all devices.</p>
Eino-Ville Talvalad8fd6792014-02-10 12:41:04 -08002859 *
2860 * @see CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002861 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002862 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002863 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002864 public static final Key<android.graphics.Rect> SCALER_CROP_REGION =
2865 new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class);
2866
2867 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002868 * <p>Duration each pixel is exposed to
2869 * light.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002870 * <p>If the sensor can't expose this exact duration, it will shorten the
2871 * duration exposed to the nearest possible value (rather than expose longer).
2872 * The final exposure time used will be available in the output capture result.</p>
2873 * <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
2874 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
2875 * <p><b>Units</b>: Nanoseconds</p>
2876 * <p><b>Range of valid values:</b><br>
2877 * {@link CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE android.sensor.info.exposureTimeRange}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002878 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2879 * <p><b>Full capability</b> -
2880 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2881 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2882 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002883 * @see CaptureRequest#CONTROL_AE_MODE
2884 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002885 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002886 * @see CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002887 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002888 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002889 public static final Key<Long> SENSOR_EXPOSURE_TIME =
2890 new Key<Long>("android.sensor.exposureTime", long.class);
2891
2892 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08002893 * <p>Duration from start of frame exposure to
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002894 * start of next frame exposure.</p>
2895 * <p>The maximum frame rate that can be supported by a camera subsystem is
2896 * a function of many factors:</p>
2897 * <ul>
2898 * <li>Requested resolutions of output image streams</li>
2899 * <li>Availability of binning / skipping modes on the imager</li>
2900 * <li>The bandwidth of the imager interface</li>
2901 * <li>The bandwidth of the various ISP processing blocks</li>
2902 * </ul>
2903 * <p>Since these factors can vary greatly between different ISPs and
2904 * sensors, the camera abstraction tries to represent the bandwidth
2905 * restrictions with as simple a model as possible.</p>
2906 * <p>The model presented has the following characteristics:</p>
2907 * <ul>
2908 * <li>The image sensor is always configured to output the smallest
2909 * resolution possible given the application's requested output stream
2910 * sizes. The smallest resolution is defined as being at least as large
2911 * as the largest requested output stream size; the camera pipeline must
2912 * never digitally upsample sensor data when the crop region covers the
2913 * whole sensor. In general, this means that if only small output stream
2914 * resolutions are configured, the sensor can provide a higher frame
2915 * rate.</li>
2916 * <li>Since any request may use any or all the currently configured
2917 * output streams, the sensor and ISP must be configured to support
2918 * scaling a single capture to all the streams at the same time. This
2919 * means the camera pipeline must be ready to produce the largest
2920 * requested output size without any delay. Therefore, the overall
2921 * frame rate of a given configured stream set is governed only by the
2922 * largest requested stream resolution.</li>
2923 * <li>Using more than one output stream in a request does not affect the
2924 * frame duration.</li>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002925 * <li>Certain format-streams may need to do additional background processing
2926 * before data is consumed/produced by that stream. These processors
2927 * can run concurrently to the rest of the camera pipeline, but
2928 * cannot process more than 1 capture at a time.</li>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002929 * </ul>
2930 * <p>The necessary information for the application, given the model above,
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002931 * is provided via the {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} field using
2932 * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration }.
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002933 * These are used to determine the maximum frame rate / minimum frame
2934 * duration that is possible for a given stream configuration.</p>
2935 * <p>Specifically, the application can use the following rules to
Igor Murashkina23ffb52014-02-07 18:52:34 -08002936 * determine the minimum frame duration it can request from the camera
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002937 * device:</p>
2938 * <ol>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002939 * <li>Let the set of currently configured input/output streams
2940 * be called <code>S</code>.</li>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002941 * <li>Find the minimum frame durations for each stream in <code>S</code>, by looking
2942 * it up in {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} using {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration }
2943 * (with its respective size/format). Let this set of frame durations be
2944 * called <code>F</code>.</li>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002945 * <li>For any given request <code>R</code>, the minimum frame duration allowed
2946 * for <code>R</code> is the maximum out of all values in <code>F</code>. Let the streams
2947 * used in <code>R</code> be called <code>S_r</code>.</li>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002948 * </ol>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002949 * <p>If none of the streams in <code>S_r</code> have a stall time (listed in {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration }
2950 * using its respective size/format), then the frame duration in <code>F</code>
2951 * determines the steady state frame rate that the application will get
2952 * if it uses <code>R</code> as a repeating request. Let this special kind of
2953 * request be called <code>Rsimple</code>.</p>
Igor Murashkina23ffb52014-02-07 18:52:34 -08002954 * <p>A repeating request <code>Rsimple</code> can be <em>occasionally</em> interleaved
2955 * by a single capture of a new request <code>Rstall</code> (which has at least
2956 * one in-use stream with a non-0 stall time) and if <code>Rstall</code> has the
2957 * same minimum frame duration this will not cause a frame rate loss
2958 * if all buffers from the previous <code>Rstall</code> have already been
2959 * delivered.</p>
2960 * <p>For more details about stalling, see
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07002961 * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration }.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002962 * <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
2963 * OFF; otherwise the auto-exposure algorithm will override this value.</p>
2964 * <p><b>Units</b>: Nanoseconds</p>
2965 * <p><b>Range of valid values:</b><br>
2966 * See {@link CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION android.sensor.info.maxFrameDuration},
2967 * {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}. The duration
2968 * is capped to <code>max(duration, exposureTime + overhead)</code>.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002969 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2970 * <p><b>Full capability</b> -
2971 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2972 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkin143aa0b2014-01-17 15:02:34 -08002973 *
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002974 * @see CaptureRequest#CONTROL_AE_MODE
2975 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002976 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Igor Murashkin9c595172014-05-12 13:56:20 -07002977 * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002978 * @see CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002979 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07002980 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07002981 public static final Key<Long> SENSOR_FRAME_DURATION =
2982 new Key<Long>("android.sensor.frameDuration", long.class);
2983
2984 /**
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07002985 * <p>The amount of gain applied to sensor data
2986 * before processing.</p>
2987 * <p>The sensitivity is the standard ISO sensitivity value,
2988 * as defined in ISO 12232:2006.</p>
2989 * <p>The sensitivity must be within {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}, and
2990 * if if it less than {@link CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY android.sensor.maxAnalogSensitivity}, the camera device
2991 * is guaranteed to use only analog amplification for applying the gain.</p>
2992 * <p>If the camera device cannot apply the exact sensitivity
2993 * requested, it will reduce the gain to the nearest supported
2994 * value. The final sensitivity used will be available in the
2995 * output capture result.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07002996 * <p><b>Units</b>: ISO arithmetic units</p>
2997 * <p><b>Range of valid values:</b><br>
2998 * {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07002999 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3000 * <p><b>Full capability</b> -
3001 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3002 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003003 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003004 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003005 * @see CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE
3006 * @see CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003007 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003008 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003009 public static final Key<Integer> SENSOR_SENSITIVITY =
3010 new Key<Integer>("android.sensor.sensitivity", int.class);
3011
3012 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003013 * <p>Time at start of exposure of first
Zhijun He0bda31a2014-06-13 14:38:39 -07003014 * row of the image sensor active array, in nanoseconds.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003015 * <p>The timestamps are also included in all image
3016 * buffers produced for the same capture, and will be identical
Zhijun He45fa43a12014-06-13 18:29:37 -07003017 * on all the outputs.</p>
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07003018 * <p>When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> UNKNOWN,
Zhijun He45fa43a12014-06-13 18:29:37 -07003019 * the timestamps measure time since an unspecified starting point,
3020 * and are monotonically increasing. They can be compared with the
3021 * timestamps for other captures from the same camera device, but are
3022 * not guaranteed to be comparable to any other time source.</p>
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07003023 * <p>When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> REALTIME, the
3024 * timestamps measure time in the same timebase as {@link android.os.SystemClock#elapsedRealtimeNanos }, and they can
3025 * be compared to other timestamps from other subsystems that
3026 * are using that base.</p>
Chien-Yu Chen6216e4e2015-05-29 11:49:54 -07003027 * <p>For reprocessing, the timestamp will match the start of exposure of
3028 * the input image, i.e. {@link CaptureResult#SENSOR_TIMESTAMP the
3029 * timestamp} in the TotalCaptureResult that was used to create the
3030 * reprocess capture request.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003031 * <p><b>Units</b>: Nanoseconds</p>
3032 * <p><b>Range of valid values:</b><br>
3033 * &gt; 0</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003034 * <p>This key is available on all devices.</p>
Zhijun He45fa43a12014-06-13 18:29:37 -07003035 *
Eino-Ville Talvalaabd9d3c2014-07-28 13:01:52 -07003036 * @see CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003037 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003038 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003039 public static final Key<Long> SENSOR_TIMESTAMP =
3040 new Key<Long>("android.sensor.timestamp", long.class);
3041
3042 /**
Ruben Brunk7c062362014-04-15 23:53:53 -07003043 * <p>The estimated camera neutral color in the native sensor colorspace at
3044 * the time of capture.</p>
3045 * <p>This value gives the neutral color point encoded as an RGB value in the
3046 * native sensor color space. The neutral color point indicates the
3047 * currently estimated white point of the scene illumination. It can be
3048 * used to interpolate between the provided color transforms when
3049 * processing raw sensor data.</p>
3050 * <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 -08003051 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3052 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003053 @PublicKey
Ruben Brunk20c76f62014-02-07 15:47:10 -08003054 public static final Key<Rational[]> SENSOR_NEUTRAL_COLOR_POINT =
3055 new Key<Rational[]>("android.sensor.neutralColorPoint", Rational[].class);
3056
3057 /**
Ruben Brunk1b1f1b62014-07-23 17:49:08 -07003058 * <p>Noise model coefficients for each CFA mosaic channel.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003059 * <p>This key contains two noise model coefficients for each CFA channel
Ruben Brunk1b1f1b62014-07-23 17:49:08 -07003060 * corresponding to the sensor amplification (S) and sensor readout
3061 * noise (O). These are given as pairs of coefficients for each channel
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003062 * in the same order as channels listed for the CFA layout key
Ruben Brunk1b1f1b62014-07-23 17:49:08 -07003063 * (see {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT android.sensor.info.colorFilterArrangement}). This is
3064 * represented as an array of Pair&lt;Double, Double&gt;, where
3065 * the first member of the Pair at index n is the S coefficient and the
3066 * second member is the O coefficient for the nth color channel in the CFA.</p>
3067 * <p>These coefficients are used in a two parameter noise model to describe
3068 * the amount of noise present in the image for each CFA channel. The
3069 * noise model used here is:</p>
3070 * <p>N(x) = sqrt(Sx + O)</p>
3071 * <p>Where x represents the recorded signal of a CFA channel normalized to
3072 * the range [0, 1], and S and O are the noise model coeffiecients for
3073 * that channel.</p>
3074 * <p>A more detailed description of the noise model can be found in the
3075 * Adobe DNG specification for the NoiseProfile tag.</p>
3076 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3077 *
3078 * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
3079 */
3080 @PublicKey
3081 public static final Key<android.util.Pair<Double,Double>[]> SENSOR_NOISE_PROFILE =
3082 new Key<android.util.Pair<Double,Double>[]>("android.sensor.noiseProfile", new TypeReference<android.util.Pair<Double,Double>[]>() {{ }});
3083
3084 /**
Ruben Brunk987d9f72014-02-11 18:00:24 -08003085 * <p>The worst-case divergence between Bayer green channels.</p>
3086 * <p>This value is an estimate of the worst case split between the
3087 * Bayer green channels in the red and blue rows in the sensor color
3088 * filter array.</p>
3089 * <p>The green split is calculated as follows:</p>
3090 * <ol>
Ruben Brunke89b1202014-03-24 17:10:35 -07003091 * <li>A 5x5 pixel (or larger) window W within the active sensor array is
3092 * chosen. The term 'pixel' here is taken to mean a group of 4 Bayer
3093 * mosaic channels (R, Gr, Gb, B). The location and size of the window
3094 * chosen is implementation defined, and should be chosen to provide a
3095 * green split estimate that is both representative of the entire image
3096 * for this camera sensor, and can be calculated quickly.</li>
Ruben Brunk987d9f72014-02-11 18:00:24 -08003097 * <li>The arithmetic mean of the green channels from the red
3098 * rows (mean_Gr) within W is computed.</li>
3099 * <li>The arithmetic mean of the green channels from the blue
3100 * rows (mean_Gb) within W is computed.</li>
3101 * <li>The maximum ratio R of the two means is computed as follows:
3102 * <code>R = max((mean_Gr + 1)/(mean_Gb + 1), (mean_Gb + 1)/(mean_Gr + 1))</code></li>
3103 * </ol>
3104 * <p>The ratio R is the green split divergence reported for this property,
3105 * which represents how much the green channels differ in the mosaic
3106 * pattern. This value is typically used to determine the treatment of
3107 * the green mosaic channels when demosaicing.</p>
3108 * <p>The green split value can be roughly interpreted as follows:</p>
3109 * <ul>
3110 * <li>R &lt; 1.03 is a negligible split (&lt;3% divergence).</li>
3111 * <li>1.20 &lt;= R &gt;= 1.03 will require some software
3112 * correction to avoid demosaic errors (3-20% divergence).</li>
3113 * <li>R &gt; 1.20 will require strong software correction to produce
3114 * a usuable image (&gt;20% divergence).</li>
3115 * </ul>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003116 * <p><b>Range of valid values:</b><br></p>
3117 * <p>&gt;= 0</p>
Ruben Brunk987d9f72014-02-11 18:00:24 -08003118 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3119 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003120 @PublicKey
Ruben Brunk987d9f72014-02-11 18:00:24 -08003121 public static final Key<Float> SENSOR_GREEN_SPLIT =
3122 new Key<Float>("android.sensor.greenSplit", float.class);
3123
3124 /**
Zhijun He379af012014-05-06 11:54:54 -07003125 * <p>A pixel <code>[R, G_even, G_odd, B]</code> that supplies the test pattern
3126 * when {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode} is SOLID_COLOR.</p>
3127 * <p>Each color channel is treated as an unsigned 32-bit integer.
3128 * The camera device then uses the most significant X bits
3129 * that correspond to how many bits are in its Bayer raw sensor
3130 * output.</p>
3131 * <p>For example, a sensor with RAW10 Bayer output would use the
3132 * 10 most significant bits from each color channel.</p>
3133 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3134 *
3135 * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
3136 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003137 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07003138 public static final Key<int[]> SENSOR_TEST_PATTERN_DATA =
3139 new Key<int[]>("android.sensor.testPatternData", int[].class);
3140
3141 /**
Igor Murashkinc127f052014-01-17 18:06:02 -08003142 * <p>When enabled, the sensor sends a test pattern instead of
3143 * doing a real exposure from the camera.</p>
3144 * <p>When a test pattern is enabled, all manual sensor controls specified
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003145 * by android.sensor.* will be ignored. All other controls should
Igor Murashkinc127f052014-01-17 18:06:02 -08003146 * work as normal.</p>
3147 * <p>For example, if manual flash is enabled, flash firing should still
3148 * occur (and that the test pattern remain unmodified, since the flash
3149 * would not actually affect it).</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003150 * <p>Defaults to OFF.</p>
3151 * <p><b>Possible values:</b>
3152 * <ul>
3153 * <li>{@link #SENSOR_TEST_PATTERN_MODE_OFF OFF}</li>
3154 * <li>{@link #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR SOLID_COLOR}</li>
3155 * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS COLOR_BARS}</li>
3156 * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY COLOR_BARS_FADE_TO_GRAY}</li>
3157 * <li>{@link #SENSOR_TEST_PATTERN_MODE_PN9 PN9}</li>
3158 * <li>{@link #SENSOR_TEST_PATTERN_MODE_CUSTOM1 CUSTOM1}</li>
3159 * </ul></p>
3160 * <p><b>Available values for this device:</b><br>
3161 * {@link CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES android.sensor.availableTestPatternModes}</p>
Igor Murashkinc127f052014-01-17 18:06:02 -08003162 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003163 *
3164 * @see CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES
Igor Murashkinc127f052014-01-17 18:06:02 -08003165 * @see #SENSOR_TEST_PATTERN_MODE_OFF
3166 * @see #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR
3167 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS
3168 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY
3169 * @see #SENSOR_TEST_PATTERN_MODE_PN9
3170 * @see #SENSOR_TEST_PATTERN_MODE_CUSTOM1
3171 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003172 @PublicKey
Igor Murashkinc127f052014-01-17 18:06:02 -08003173 public static final Key<Integer> SENSOR_TEST_PATTERN_MODE =
3174 new Key<Integer>("android.sensor.testPatternMode", int.class);
3175
3176 /**
Zhijun He0bda31a2014-06-13 14:38:39 -07003177 * <p>Duration between the start of first row exposure
3178 * and the start of last row exposure.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003179 * <p>This is the exposure time skew between the first and last
3180 * row exposure start times. The first row and the last row are
3181 * the first and last rows inside of the
3182 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
Zhijun He0bda31a2014-06-13 14:38:39 -07003183 * <p>For typical camera sensors that use rolling shutters, this is also equivalent
3184 * to the frame readout time.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003185 * <p><b>Units</b>: Nanoseconds</p>
3186 * <p><b>Range of valid values:</b><br>
3187 * &gt;= 0 and &lt;
Eino-Ville Talvalab6eb52f2015-04-16 16:39:45 -07003188 * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration }.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003189 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3190 * <p><b>Limited capability</b> -
3191 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
3192 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He0bda31a2014-06-13 14:38:39 -07003193 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003194 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He0bda31a2014-06-13 14:38:39 -07003195 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3196 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003197 @PublicKey
Zhijun He0bda31a2014-06-13 14:38:39 -07003198 public static final Key<Long> SENSOR_ROLLING_SHUTTER_SKEW =
3199 new Key<Long>("android.sensor.rollingShutterSkew", long.class);
3200
3201 /**
Zhijun Heba93fe62014-01-17 16:43:05 -08003202 * <p>Quality of lens shading correction applied
3203 * to the image data.</p>
3204 * <p>When set to OFF mode, no lens shading correction will be applied by the
3205 * camera device, and an identity lens shading map data will be provided
3206 * 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 -07003207 * shading map with size of <code>[ 4, 3 ]</code>,
3208 * the output {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap} for this case will be an identity
3209 * map shown below:</p>
Zhijun Heba93fe62014-01-17 16:43:05 -08003210 * <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 -07003211 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
3212 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
3213 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
3214 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,
3215 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ]
Zhijun Heba93fe62014-01-17 16:43:05 -08003216 * </code></pre>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003217 * <p>When set to other modes, lens shading correction will be applied by the camera
3218 * device. Applications can request lens shading map data by setting
3219 * {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} to ON, and then the camera device will provide lens
3220 * shading map data in {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap}; the returned shading map
3221 * data will be the one applied by the camera device for this capture request.</p>
3222 * <p>The shading map data may depend on the auto-exposure (AE) and AWB statistics, therefore
3223 * the reliability of the map data may be affected by the AE and AWB algorithms. When AE and
3224 * 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>
3225 * OFF), to get best results, it is recommended that the applications wait for the AE and AWB
3226 * to be converged before using the returned shading map data.</p>
3227 * <p><b>Possible values:</b>
3228 * <ul>
3229 * <li>{@link #SHADING_MODE_OFF OFF}</li>
3230 * <li>{@link #SHADING_MODE_FAST FAST}</li>
3231 * <li>{@link #SHADING_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
3232 * </ul></p>
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003233 * <p><b>Available values for this device:</b><br>
3234 * {@link CameraCharacteristics#SHADING_AVAILABLE_MODES android.shading.availableModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003235 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3236 * <p><b>Full capability</b> -
3237 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3238 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun Heba93fe62014-01-17 16:43:05 -08003239 *
Zhijun Hefa7c7552014-05-22 16:36:02 -07003240 * @see CaptureRequest#CONTROL_AE_MODE
3241 * @see CaptureRequest#CONTROL_AWB_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003242 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003243 * @see CameraCharacteristics#SHADING_AVAILABLE_MODES
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003244 * @see CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP
Zhijun Heba93fe62014-01-17 16:43:05 -08003245 * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
3246 * @see #SHADING_MODE_OFF
3247 * @see #SHADING_MODE_FAST
3248 * @see #SHADING_MODE_HIGH_QUALITY
Zhijun Heba93fe62014-01-17 16:43:05 -08003249 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003250 @PublicKey
Zhijun Heba93fe62014-01-17 16:43:05 -08003251 public static final Key<Integer> SHADING_MODE =
3252 new Key<Integer>("android.shading.mode", int.class);
3253
3254 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003255 * <p>Operating mode for the face detector
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003256 * unit.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08003257 * <p>Whether face detection is enabled, and whether it
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003258 * should output just the basic fields or the full set of
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003259 * fields.</p>
3260 * <p><b>Possible values:</b>
3261 * <ul>
3262 * <li>{@link #STATISTICS_FACE_DETECT_MODE_OFF OFF}</li>
3263 * <li>{@link #STATISTICS_FACE_DETECT_MODE_SIMPLE SIMPLE}</li>
3264 * <li>{@link #STATISTICS_FACE_DETECT_MODE_FULL FULL}</li>
3265 * </ul></p>
3266 * <p><b>Available values for this device:</b><br>
3267 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}</p>
3268 * <p>This key is available on all devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003269 *
3270 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003271 * @see #STATISTICS_FACE_DETECT_MODE_OFF
3272 * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE
3273 * @see #STATISTICS_FACE_DETECT_MODE_FULL
3274 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003275 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003276 public static final Key<Integer> STATISTICS_FACE_DETECT_MODE =
3277 new Key<Integer>("android.statistics.faceDetectMode", int.class);
3278
3279 /**
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003280 * <p>List of unique IDs for detected faces.</p>
3281 * <p>Each detected face is given a unique ID that is valid for as long as the face is visible
3282 * to the camera device. A face that leaves the field of view and later returns may be
3283 * assigned a new ID.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003284 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL
3285 * This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003286 *
3287 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003288 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003289 */
3290 public static final Key<int[]> STATISTICS_FACE_IDS =
3291 new Key<int[]>("android.statistics.faceIds", int[].class);
3292
3293 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003294 * <p>List of landmarks for detected
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003295 * faces.</p>
3296 * <p>The coordinate system is that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
3297 * <code>(0, 0)</code> being the top-left pixel of the active array.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003298 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL
3299 * This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003300 *
3301 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3302 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003303 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003304 */
3305 public static final Key<int[]> STATISTICS_FACE_LANDMARKS =
3306 new Key<int[]>("android.statistics.faceLandmarks", int[].class);
3307
3308 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003309 * <p>List of the bounding rectangles for detected
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003310 * faces.</p>
3311 * <p>The coordinate system is that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
3312 * <code>(0, 0)</code> being the top-left pixel of the active array.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003313 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} != OFF
3314 * This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003315 *
3316 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3317 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003318 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003319 */
3320 public static final Key<android.graphics.Rect[]> STATISTICS_FACE_RECTANGLES =
3321 new Key<android.graphics.Rect[]>("android.statistics.faceRectangles", android.graphics.Rect[].class);
3322
3323 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003324 * <p>List of the face confidence scores for
3325 * detected faces</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003326 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} != OFF.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003327 * <p><b>Range of valid values:</b><br>
3328 * 1-100</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003329 * <p>This key is available on all devices.</p>
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003330 *
3331 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
Zhijun He7f80d6f2013-11-04 10:18:05 -08003332 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003333 */
3334 public static final Key<byte[]> STATISTICS_FACE_SCORES =
3335 new Key<byte[]>("android.statistics.faceScores", byte[].class);
3336
3337 /**
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003338 * <p>List of the faces detected through camera face detection
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003339 * in this capture.</p>
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003340 * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} <code>!=</code> OFF.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003341 * <p>This key is available on all devices.</p>
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003342 *
3343 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
3344 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003345 @PublicKey
3346 @SyntheticKey
Igor Murashkin72f9f0a2014-05-14 15:46:10 -07003347 public static final Key<android.hardware.camera2.params.Face[]> STATISTICS_FACES =
3348 new Key<android.hardware.camera2.params.Face[]>("android.statistics.faces", android.hardware.camera2.params.Face[].class);
3349
3350 /**
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003351 * <p>The shading map is a low-resolution floating-point map
3352 * that lists the coefficients used to correct for vignetting, for each
3353 * Bayer color channel.</p>
3354 * <p>The least shaded section of the image should have a gain factor
3355 * of 1; all other sections should have gains above 1.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003356 * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map
Igor Murashkinace5bf02013-12-10 17:36:40 -08003357 * must take into account the colorCorrection settings.</p>
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003358 * <p>The shading map is for the entire active pixel array, and is not
3359 * affected by the crop region specified in the request. Each shading map
3360 * entry is the value of the shading compensation map over a specific
3361 * pixel on the sensor. Specifically, with a (N x M) resolution shading
3362 * map, and an active pixel array size (W x H), shading map entry
3363 * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at
3364 * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
3365 * The map is assumed to be bilinearly interpolated between the sample points.</p>
3366 * <p>The channel order is [R, Geven, Godd, B], where Geven is the green
3367 * channel for the even rows of a Bayer pattern, and Godd is the odd rows.
Ruben Brunk57493682014-05-27 18:58:08 -07003368 * The shading map is stored in a fully interleaved format.</p>
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003369 * <p>The shading map should have on the order of 30-40 rows and columns,
3370 * and must be smaller than 64x64.</p>
3371 * <p>As an example, given a very small map defined as:</p>
Ruben Brunk57493682014-05-27 18:58:08 -07003372 * <pre><code>width,height = [ 4, 3 ]
3373 * values =
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003374 * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2,
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003375 * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3,
3376 * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0,
3377 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2,
3378 * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2,
3379 * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ]
Igor Murashkin7a9b30e2013-12-11 13:31:38 -08003380 * </code></pre>
3381 * <p>The low-resolution scaling map images for each channel are
3382 * (displayed using nearest-neighbor interpolation):</p>
3383 * <p><img alt="Red lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" />
3384 * <img alt="Green (even rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" />
3385 * <img alt="Green (odd rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" />
3386 * <img alt="Blue lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/blue_shading.png" /></p>
3387 * <p>As a visualization only, inverting the full-color map to recover an
3388 * image of a gray wall (using bicubic interpolation for visual quality) as captured by the sensor gives:</p>
3389 * <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 -07003390 * <p><b>Range of valid values:</b><br>
3391 * Each gain factor is &gt;= 1</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003392 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3393 * <p><b>Full capability</b> -
3394 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3395 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003396 *
Zhijun He5f2a47f2014-01-16 15:44:41 -08003397 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003398 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk57493682014-05-27 18:58:08 -07003399 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003400 @PublicKey
Ruben Brunk57493682014-05-27 18:58:08 -07003401 public static final Key<android.hardware.camera2.params.LensShadingMap> STATISTICS_LENS_SHADING_CORRECTION_MAP =
3402 new Key<android.hardware.camera2.params.LensShadingMap>("android.statistics.lensShadingCorrectionMap", android.hardware.camera2.params.LensShadingMap.class);
3403
3404 /**
3405 * <p>The shading map is a low-resolution floating-point map
3406 * that lists the coefficients used to correct for vignetting, for each
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003407 * Bayer color channel of RAW image data.</p>
Ruben Brunk57493682014-05-27 18:58:08 -07003408 * <p>The least shaded section of the image should have a gain factor
3409 * of 1; all other sections should have gains above 1.</p>
3410 * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map
3411 * must take into account the colorCorrection settings.</p>
3412 * <p>The shading map is for the entire active pixel array, and is not
3413 * affected by the crop region specified in the request. Each shading map
3414 * entry is the value of the shading compensation map over a specific
3415 * pixel on the sensor. Specifically, with a (N x M) resolution shading
3416 * map, and an active pixel array size (W x H), shading map entry
3417 * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at
3418 * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
3419 * The map is assumed to be bilinearly interpolated between the sample points.</p>
3420 * <p>The channel order is [R, Geven, Godd, B], where Geven is the green
3421 * channel for the even rows of a Bayer pattern, and Godd is the odd rows.
3422 * The shading map is stored in a fully interleaved format, and its size
3423 * is provided in the camera static metadata by android.lens.info.shadingMapSize.</p>
3424 * <p>The shading map should have on the order of 30-40 rows and columns,
3425 * and must be smaller than 64x64.</p>
3426 * <p>As an example, given a very small map defined as:</p>
3427 * <pre><code>android.lens.info.shadingMapSize = [ 4, 3 ]
3428 * android.statistics.lensShadingMap =
3429 * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2,
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003430 * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3,
3431 * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0,
3432 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2,
3433 * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2,
3434 * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ]
Ruben Brunk57493682014-05-27 18:58:08 -07003435 * </code></pre>
3436 * <p>The low-resolution scaling map images for each channel are
3437 * (displayed using nearest-neighbor interpolation):</p>
3438 * <p><img alt="Red lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" />
3439 * <img alt="Green (even rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" />
3440 * <img alt="Green (odd rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" />
3441 * <img alt="Blue lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/blue_shading.png" /></p>
3442 * <p>As a visualization only, inverting the full-color map to recover an
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003443 * image of a gray wall (using bicubic interpolation for visual quality)
3444 * as captured by the sensor gives:</p>
Ruben Brunk57493682014-05-27 18:58:08 -07003445 * <p><img alt="Image of a uniform white wall (inverse shading map)" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/inv_shading.png" /></p>
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003446 * <p>Note that the RAW image data might be subject to lens shading
3447 * correction not reported on this map. Query
3448 * {@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied} to see if RAW image data has subject
3449 * to lens shading correction. If {@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied}
3450 * is TRUE, the RAW image data is subject to partial or full lens shading
3451 * correction. In the case full lens shading correction is applied to RAW
3452 * images, the gain factor map reported in this key will contain all 1.0 gains.
3453 * In other words, the map reported in this key is the remaining lens shading
3454 * that needs to be applied on the RAW image to get images without lens shading
3455 * artifacts. See {@link CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_RAW android.request.maxNumOutputRaw} for a list of RAW image
3456 * formats.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003457 * <p><b>Range of valid values:</b><br>
3458 * Each gain factor is &gt;= 1</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003459 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3460 * <p><b>Full capability</b> -
3461 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3462 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Ruben Brunk57493682014-05-27 18:58:08 -07003463 *
3464 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003465 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003466 * @see CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_RAW
3467 * @see CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED
Ruben Brunk57493682014-05-27 18:58:08 -07003468 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003469 */
3470 public static final Key<float[]> STATISTICS_LENS_SHADING_MAP =
3471 new Key<float[]>("android.statistics.lensShadingMap", float[].class);
3472
3473 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003474 * <p>The best-fit color channel gains calculated
Zhijun Hecc28a412014-02-24 15:11:23 -08003475 * by the camera device's statistics units for the current output frame.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -08003476 * <p>This may be different than the gains used for this frame,
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003477 * since statistics processing on data from a new frame
3478 * typically completes after the transform has already been
Igor Murashkinace5bf02013-12-10 17:36:40 -08003479 * applied to that frame.</p>
3480 * <p>The 4 channel gains are defined in Bayer domain,
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003481 * see {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} for details.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003482 * <p>This value should always be calculated by the auto-white balance (AWB) block,
Igor Murashkinace5bf02013-12-10 17:36:40 -08003483 * regardless of the android.control.* current values.</p>
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08003484 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003485 *
3486 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Igor Murashkin9c595172014-05-12 13:56:20 -07003487 * @deprecated
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08003488 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003489 */
Igor Murashkin9c595172014-05-12 13:56:20 -07003490 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003491 public static final Key<float[]> STATISTICS_PREDICTED_COLOR_GAINS =
3492 new Key<float[]>("android.statistics.predictedColorGains", float[].class);
3493
3494 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003495 * <p>The best-fit color transform matrix estimate
Zhijun Hecc28a412014-02-24 15:11:23 -08003496 * calculated by the camera device's statistics units for the current
3497 * output frame.</p>
3498 * <p>The camera device will provide the estimate from its
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003499 * statistics unit on the white balance transforms to use
Zhijun Hecc28a412014-02-24 15:11:23 -08003500 * for the next frame. These are the values the camera device believes
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003501 * are the best fit for the current output frame. This may
3502 * be different than the transform used for this frame, since
3503 * statistics processing on data from a new frame typically
3504 * completes after the transform has already been applied to
Igor Murashkinace5bf02013-12-10 17:36:40 -08003505 * that frame.</p>
3506 * <p>These estimates must be provided for all frames, even if
3507 * capture settings and color transforms are set by the application.</p>
Eino-Ville Talvalab67a3b32014-06-06 13:07:20 -07003508 * <p>This value should always be calculated by the auto-white balance (AWB) block,
Igor Murashkinace5bf02013-12-10 17:36:40 -08003509 * regardless of the android.control.* current values.</p>
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08003510 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Igor Murashkin9c595172014-05-12 13:56:20 -07003511 * @deprecated
Igor Murashkinaef3b7e2014-01-15 13:20:37 -08003512 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003513 */
Igor Murashkin9c595172014-05-12 13:56:20 -07003514 @Deprecated
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003515 public static final Key<Rational[]> STATISTICS_PREDICTED_COLOR_TRANSFORM =
3516 new Key<Rational[]>("android.statistics.predictedColorTransform", Rational[].class);
3517
3518 /**
Zhijun He208fb6c2014-02-03 13:09:06 -08003519 * <p>The camera device estimated scene illumination lighting
3520 * frequency.</p>
3521 * <p>Many light sources, such as most fluorescent lights, flicker at a rate
3522 * that depends on the local utility power standards. This flicker must be
3523 * accounted for by auto-exposure routines to avoid artifacts in captured images.
3524 * The camera device uses this entry to tell the application what the scene
3525 * illuminant frequency is.</p>
3526 * <p>When manual exposure control is enabled
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003527 * (<code>{@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} == OFF</code> or <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} ==
3528 * OFF</code>), the {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} doesn't perform
3529 * antibanding, and the application can ensure it selects
3530 * exposure times that do not cause banding issues by looking
3531 * into this metadata field. See
3532 * {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} for more details.</p>
3533 * <p>Reports NONE if there doesn't appear to be flickering illumination.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003534 * <p><b>Possible values:</b>
3535 * <ul>
3536 * <li>{@link #STATISTICS_SCENE_FLICKER_NONE NONE}</li>
3537 * <li>{@link #STATISTICS_SCENE_FLICKER_50HZ 50HZ}</li>
3538 * <li>{@link #STATISTICS_SCENE_FLICKER_60HZ 60HZ}</li>
3539 * </ul></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003540 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3541 * <p><b>Full capability</b> -
3542 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3543 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He208fb6c2014-02-03 13:09:06 -08003544 *
3545 * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
3546 * @see CaptureRequest#CONTROL_AE_MODE
3547 * @see CaptureRequest#CONTROL_MODE
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003548 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003549 * @see #STATISTICS_SCENE_FLICKER_NONE
3550 * @see #STATISTICS_SCENE_FLICKER_50HZ
3551 * @see #STATISTICS_SCENE_FLICKER_60HZ
3552 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003553 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003554 public static final Key<Integer> STATISTICS_SCENE_FLICKER =
3555 new Key<Integer>("android.statistics.sceneFlicker", int.class);
3556
3557 /**
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003558 * <p>Operating mode for hot pixel map generation.</p>
3559 * <p>If set to <code>true</code>, a hot pixel map is returned in {@link CaptureResult#STATISTICS_HOT_PIXEL_MAP android.statistics.hotPixelMap}.
3560 * If set to <code>false</code>, no hot pixel map will be returned.</p>
3561 * <p><b>Range of valid values:</b><br>
3562 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES android.statistics.info.availableHotPixelMapModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003563 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08003564 *
3565 * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP
3566 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES
3567 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003568 @PublicKey
Ruben Brunk9d454fd2014-03-04 14:11:52 -08003569 public static final Key<Boolean> STATISTICS_HOT_PIXEL_MAP_MODE =
3570 new Key<Boolean>("android.statistics.hotPixelMapMode", boolean.class);
3571
3572 /**
3573 * <p>List of <code>(x, y)</code> coordinates of hot/defective pixels on the sensor.</p>
3574 * <p>A coordinate <code>(x, y)</code> must lie between <code>(0, 0)</code>, and
3575 * <code>(width - 1, height - 1)</code> (inclusive), which are the top-left and
3576 * bottom-right of the pixel array, respectively. The width and
3577 * height dimensions are given in {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.
3578 * This may include hot pixels that lie outside of the active array
3579 * bounds given by {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003580 * <p><b>Range of valid values:</b><br></p>
3581 * <p>n &lt;= number of pixels on the sensor.
3582 * The <code>(x, y)</code> coordinates must be bounded by
3583 * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003584 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Ruben Brunk9d454fd2014-03-04 14:11:52 -08003585 *
3586 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3587 * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
3588 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003589 @PublicKey
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003590 public static final Key<android.graphics.Point[]> STATISTICS_HOT_PIXEL_MAP =
3591 new Key<android.graphics.Point[]>("android.statistics.hotPixelMap", android.graphics.Point[].class);
Ruben Brunk9d454fd2014-03-04 14:11:52 -08003592
3593 /**
Zhijun He379af012014-05-06 11:54:54 -07003594 * <p>Whether the camera device will output the lens
3595 * shading map in output result metadata.</p>
3596 * <p>When set to ON,
Eino-Ville Talvalae600d6a2014-06-09 14:25:50 -07003597 * android.statistics.lensShadingMap will be provided in
Zhijun He379af012014-05-06 11:54:54 -07003598 * the output result metadata.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003599 * <p>ON is always supported on devices with the RAW capability.</p>
3600 * <p><b>Possible values:</b>
3601 * <ul>
3602 * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_OFF OFF}</li>
3603 * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_ON ON}</li>
3604 * </ul></p>
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003605 * <p><b>Available values for this device:</b><br>
3606 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES android.statistics.info.availableLensShadingMapModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003607 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3608 * <p><b>Full capability</b> -
3609 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3610 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3611 *
3612 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yehe4aa2832015-02-06 15:15:53 -08003613 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES
Zhijun He379af012014-05-06 11:54:54 -07003614 * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF
3615 * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON
3616 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003617 @PublicKey
Zhijun He379af012014-05-06 11:54:54 -07003618 public static final Key<Integer> STATISTICS_LENS_SHADING_MAP_MODE =
3619 new Key<Integer>("android.statistics.lensShadingMapMode", int.class);
3620
3621 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003622 * <p>Tonemapping / contrast / gamma curve for the blue
Igor Murashkine0060932014-01-17 17:24:11 -08003623 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
3624 * CONTRAST_CURVE.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003625 * <p>See android.tonemap.curveRed for more details.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003626 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3627 * <p><b>Full capability</b> -
3628 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3629 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003630 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003631 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He5f2a47f2014-01-16 15:44:41 -08003632 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003633 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003634 */
Zhijun He3ffd7052013-08-19 15:45:08 -07003635 public static final Key<float[]> TONEMAP_CURVE_BLUE =
3636 new Key<float[]>("android.tonemap.curveBlue", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003637
3638 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003639 * <p>Tonemapping / contrast / gamma curve for the green
Igor Murashkine0060932014-01-17 17:24:11 -08003640 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
3641 * CONTRAST_CURVE.</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003642 * <p>See android.tonemap.curveRed for more details.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003643 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3644 * <p><b>Full capability</b> -
3645 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3646 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003647 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003648 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He5f2a47f2014-01-16 15:44:41 -08003649 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003650 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003651 */
Zhijun He3ffd7052013-08-19 15:45:08 -07003652 public static final Key<float[]> TONEMAP_CURVE_GREEN =
3653 new Key<float[]>("android.tonemap.curveGreen", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003654
3655 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003656 * <p>Tonemapping / contrast / gamma curve for the red
Igor Murashkine0060932014-01-17 17:24:11 -08003657 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
3658 * CONTRAST_CURVE.</p>
3659 * <p>Each channel's curve is defined by an array of control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003660 * <pre><code>android.tonemap.curveRed =
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003661 * [ P0in, P0out, P1in, P1out, P2in, P2out, P3in, P3out, ..., PNin, PNout ]
Zhijun He870922b2014-02-15 21:47:51 -08003662 * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003663 * <p>These are sorted in order of increasing <code>Pin</code>; it is
3664 * required that input values 0.0 and 1.0 are included in the list to
Igor Murashkine0060932014-01-17 17:24:11 -08003665 * define a complete mapping. For input values between control points,
3666 * the camera device must linearly interpolate between the control
3667 * points.</p>
3668 * <p>Each curve can have an independent number of points, and the number
3669 * of points can be less than max (that is, the request doesn't have to
3670 * always provide a curve with number of points equivalent to
3671 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
3672 * <p>A few examples, and their corresponding graphical mappings; these
3673 * only specify the red channel and the precision is limited to 4
3674 * digits, for conciseness.</p>
3675 * <p>Linear mapping:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003676 * <pre><code>android.tonemap.curveRed = [ 0, 0, 1.0, 1.0 ]
Igor Murashkine0060932014-01-17 17:24:11 -08003677 * </code></pre>
3678 * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p>
3679 * <p>Invert mapping:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003680 * <pre><code>android.tonemap.curveRed = [ 0, 1.0, 1.0, 0 ]
Igor Murashkine0060932014-01-17 17:24:11 -08003681 * </code></pre>
3682 * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p>
3683 * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003684 * <pre><code>android.tonemap.curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003685 * 0.0000, 0.0000, 0.0667, 0.2920, 0.1333, 0.4002, 0.2000, 0.4812,
3686 * 0.2667, 0.5484, 0.3333, 0.6069, 0.4000, 0.6594, 0.4667, 0.7072,
3687 * 0.5333, 0.7515, 0.6000, 0.7928, 0.6667, 0.8317, 0.7333, 0.8685,
3688 * 0.8000, 0.9035, 0.8667, 0.9370, 0.9333, 0.9691, 1.0000, 1.0000 ]
Igor Murashkine0060932014-01-17 17:24:11 -08003689 * </code></pre>
3690 * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p>
3691 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003692 * <pre><code>android.tonemap.curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003693 * 0.0000, 0.0000, 0.0667, 0.2864, 0.1333, 0.4007, 0.2000, 0.4845,
3694 * 0.2667, 0.5532, 0.3333, 0.6125, 0.4000, 0.6652, 0.4667, 0.7130,
3695 * 0.5333, 0.7569, 0.6000, 0.7977, 0.6667, 0.8360, 0.7333, 0.8721,
3696 * 0.8000, 0.9063, 0.8667, 0.9389, 0.9333, 0.9701, 1.0000, 1.0000 ]
Igor Murashkine0060932014-01-17 17:24:11 -08003697 * </code></pre>
3698 * <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 -07003699 * <p><b>Range of valid values:</b><br>
3700 * 0-1 on both input and output coordinates, normalized
3701 * as a floating-point value such that 0 == black and 1 == white.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003702 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3703 * <p><b>Full capability</b> -
3704 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3705 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003706 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003707 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Igor Murashkine0060932014-01-17 17:24:11 -08003708 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003709 * @see CaptureRequest#TONEMAP_MODE
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003710 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003711 */
3712 public static final Key<float[]> TONEMAP_CURVE_RED =
3713 new Key<float[]>("android.tonemap.curveRed", float[].class);
3714
3715 /**
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003716 * <p>Tonemapping / contrast / gamma curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode}
3717 * is CONTRAST_CURVE.</p>
3718 * <p>The tonemapCurve consist of three curves for each of red, green, and blue
3719 * channels respectively. The following example uses the red channel as an
3720 * example. The same logic applies to green and blue channel.
3721 * Each channel's curve is defined by an array of control points:</p>
3722 * <pre><code>curveRed =
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003723 * [ P0(in, out), P1(in, out), P2(in, out), P3(in, out), ..., PN(in, out) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003724 * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
3725 * <p>These are sorted in order of increasing <code>Pin</code>; it is always
3726 * guaranteed that input values 0.0 and 1.0 are included in the list to
3727 * define a complete mapping. For input values between control points,
3728 * the camera device must linearly interpolate between the control
3729 * points.</p>
3730 * <p>Each curve can have an independent number of points, and the number
3731 * of points can be less than max (that is, the request doesn't have to
3732 * always provide a curve with number of points equivalent to
3733 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
3734 * <p>A few examples, and their corresponding graphical mappings; these
3735 * only specify the red channel and the precision is limited to 4
3736 * digits, for conciseness.</p>
3737 * <p>Linear mapping:</p>
3738 * <pre><code>curveRed = [ (0, 0), (1.0, 1.0) ]
3739 * </code></pre>
3740 * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p>
3741 * <p>Invert mapping:</p>
3742 * <pre><code>curveRed = [ (0, 1.0), (1.0, 0) ]
3743 * </code></pre>
3744 * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p>
3745 * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
3746 * <pre><code>curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003747 * (0.0000, 0.0000), (0.0667, 0.2920), (0.1333, 0.4002), (0.2000, 0.4812),
3748 * (0.2667, 0.5484), (0.3333, 0.6069), (0.4000, 0.6594), (0.4667, 0.7072),
3749 * (0.5333, 0.7515), (0.6000, 0.7928), (0.6667, 0.8317), (0.7333, 0.8685),
3750 * (0.8000, 0.9035), (0.8667, 0.9370), (0.9333, 0.9691), (1.0000, 1.0000) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003751 * </code></pre>
3752 * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p>
3753 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
3754 * <pre><code>curveRed = [
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003755 * (0.0000, 0.0000), (0.0667, 0.2864), (0.1333, 0.4007), (0.2000, 0.4845),
3756 * (0.2667, 0.5532), (0.3333, 0.6125), (0.4000, 0.6652), (0.4667, 0.7130),
3757 * (0.5333, 0.7569), (0.6000, 0.7977), (0.6667, 0.8360), (0.7333, 0.8721),
3758 * (0.8000, 0.9063), (0.8667, 0.9389), (0.9333, 0.9701), (1.0000, 1.0000) ]
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003759 * </code></pre>
3760 * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003761 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3762 * <p><b>Full capability</b> -
3763 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3764 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003765 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003766 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003767 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
3768 * @see CaptureRequest#TONEMAP_MODE
3769 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003770 @PublicKey
3771 @SyntheticKey
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003772 public static final Key<android.hardware.camera2.params.TonemapCurve> TONEMAP_CURVE =
3773 new Key<android.hardware.camera2.params.TonemapCurve>("android.tonemap.curve", android.hardware.camera2.params.TonemapCurve.class);
3774
3775 /**
Igor Murashkine0060932014-01-17 17:24:11 -08003776 * <p>High-level global contrast/gamma/tonemapping control.</p>
3777 * <p>When switching to an application-defined contrast curve by setting
3778 * {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} to CONTRAST_CURVE, the curve is defined
3779 * per-channel with a set of <code>(in, out)</code> points that specify the
3780 * mapping from input high-bit-depth pixel value to the output
3781 * low-bit-depth value. Since the actual pixel ranges of both input
3782 * and output may change depending on the camera pipeline, the values
3783 * are specified by normalized floating-point numbers.</p>
3784 * <p>More-complex color mapping operations such as 3D color look-up
3785 * tables, selective chroma enhancement, or other non-linear color
3786 * transforms will be disabled when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
3787 * CONTRAST_CURVE.</p>
3788 * <p>When using either FAST or HIGH_QUALITY, the camera device will
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003789 * emit its own tonemap curve in {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}.
Igor Murashkine0060932014-01-17 17:24:11 -08003790 * These values are always available, and as close as possible to the
3791 * actually used nonlinear/nonglobal transforms.</p>
Zhijun Hefa7c7552014-05-22 16:36:02 -07003792 * <p>If a request is sent with CONTRAST_CURVE with the camera device's
Igor Murashkine0060932014-01-17 17:24:11 -08003793 * provided curve in FAST or HIGH_QUALITY, the image's tonemap will be
3794 * roughly the same.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003795 * <p><b>Possible values:</b>
3796 * <ul>
3797 * <li>{@link #TONEMAP_MODE_CONTRAST_CURVE CONTRAST_CURVE}</li>
3798 * <li>{@link #TONEMAP_MODE_FAST FAST}</li>
3799 * <li>{@link #TONEMAP_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08003800 * <li>{@link #TONEMAP_MODE_GAMMA_VALUE GAMMA_VALUE}</li>
3801 * <li>{@link #TONEMAP_MODE_PRESET_CURVE PRESET_CURVE}</li>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003802 * </ul></p>
3803 * <p><b>Available values for this device:</b><br>
3804 * {@link CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES android.tonemap.availableToneMapModes}</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003805 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3806 * <p><b>Full capability</b> -
3807 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3808 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -08003809 *
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003810 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Ruben Brunk6dc379c2014-03-04 15:04:00 -08003811 * @see CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES
Yin-Chia Yeh8490ace2014-05-27 10:04:54 -07003812 * @see CaptureRequest#TONEMAP_CURVE
Igor Murashkine0060932014-01-17 17:24:11 -08003813 * @see CaptureRequest#TONEMAP_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003814 * @see #TONEMAP_MODE_CONTRAST_CURVE
3815 * @see #TONEMAP_MODE_FAST
3816 * @see #TONEMAP_MODE_HIGH_QUALITY
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08003817 * @see #TONEMAP_MODE_GAMMA_VALUE
3818 * @see #TONEMAP_MODE_PRESET_CURVE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003819 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003820 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003821 public static final Key<Integer> TONEMAP_MODE =
3822 new Key<Integer>("android.tonemap.mode", int.class);
3823
3824 /**
Yin-Chia Yeh956c52b2015-02-06 11:23:25 -08003825 * <p>Tonemapping curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
3826 * GAMMA_VALUE</p>
3827 * <p>The tonemap curve will be defined the following formula:
3828 * * OUT = pow(IN, 1.0 / gamma)
3829 * where IN and OUT is the input pixel value scaled to range [0.0, 1.0],
3830 * pow is the power function and gamma is the gamma value specified by this
3831 * key.</p>
3832 * <p>The same curve will be applied to all color channels. The camera device
3833 * may clip the input gamma value to its supported range. The actual applied
3834 * value will be returned in capture result.</p>
3835 * <p>The valid range of gamma value varies on different devices, but values
3836 * within [1.0, 5.0] are guaranteed not to be clipped.</p>
3837 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3838 *
3839 * @see CaptureRequest#TONEMAP_MODE
3840 */
3841 @PublicKey
3842 public static final Key<Float> TONEMAP_GAMMA =
3843 new Key<Float>("android.tonemap.gamma", float.class);
3844
3845 /**
3846 * <p>Tonemapping curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
3847 * PRESET_CURVE</p>
3848 * <p>The tonemap curve will be defined by specified standard.</p>
3849 * <p>sRGB (approximated by 16 control points):</p>
3850 * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p>
3851 * <p>Rec. 709 (approximated by 16 control points):</p>
3852 * <p><img alt="Rec. 709 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/rec709_tonemap.png" /></p>
3853 * <p>Note that above figures show a 16 control points approximation of preset
3854 * curves. Camera devices may apply a different approximation to the curve.</p>
3855 * <p><b>Possible values:</b>
3856 * <ul>
3857 * <li>{@link #TONEMAP_PRESET_CURVE_SRGB SRGB}</li>
3858 * <li>{@link #TONEMAP_PRESET_CURVE_REC709 REC709}</li>
3859 * </ul></p>
3860 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3861 *
3862 * @see CaptureRequest#TONEMAP_MODE
3863 * @see #TONEMAP_PRESET_CURVE_SRGB
3864 * @see #TONEMAP_PRESET_CURVE_REC709
3865 */
3866 @PublicKey
3867 public static final Key<Integer> TONEMAP_PRESET_CURVE =
3868 new Key<Integer>("android.tonemap.presetCurve", int.class);
3869
3870 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003871 * <p>This LED is nominally used to indicate to the user
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003872 * that the camera is powered on and may be streaming images back to the
3873 * Application Processor. In certain rare circumstances, the OS may
3874 * disable this when video is processed locally and not transmitted to
Igor Murashkinace5bf02013-12-10 17:36:40 -08003875 * any untrusted applications.</p>
3876 * <p>In particular, the LED <em>must</em> always be on when the data could be
3877 * transmitted off the device. The LED <em>should</em> always be on whenever
3878 * data is stored locally on the device.</p>
3879 * <p>The LED <em>may</em> be off if a trusted application is using the data that
3880 * doesn't violate the above rules.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003881 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003882 * @hide
3883 */
3884 public static final Key<Boolean> LED_TRANSMIT =
3885 new Key<Boolean>("android.led.transmit", boolean.class);
3886
3887 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -08003888 * <p>Whether black-level compensation is locked
Eino-Ville Talvala0956af52013-12-26 13:19:10 -08003889 * to its current values, or is free to vary.</p>
3890 * <p>Whether the black level offset was locked for this frame. Should be
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003891 * 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 -08003892 * a change in other capture settings forced the camera device to
3893 * perform a black level reset.</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003894 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3895 * <p><b>Full capability</b> -
3896 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
3897 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -08003898 *
3899 * @see CaptureRequest#BLACK_LEVEL_LOCK
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003900 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003901 */
Igor Murashkin6c76f582014-07-15 17:19:49 -07003902 @PublicKey
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07003903 public static final Key<Boolean> BLACK_LEVEL_LOCK =
3904 new Key<Boolean>("android.blackLevel.lock", boolean.class);
3905
Igor Murashkin3865a842014-01-17 18:18:39 -08003906 /**
3907 * <p>The frame number corresponding to the last request
3908 * with which the output result (metadata + buffers) has been fully
3909 * synchronized.</p>
3910 * <p>When a request is submitted to the camera device, there is usually a
3911 * delay of several frames before the controls get applied. A camera
3912 * device may either choose to account for this delay by implementing a
3913 * pipeline and carefully submit well-timed atomic control updates, or
3914 * it may start streaming control changes that span over several frame
3915 * boundaries.</p>
3916 * <p>In the latter case, whenever a request's settings change relative to
3917 * the previous submitted request, the full set of changes may take
3918 * multiple frame durations to fully take effect. Some settings may
3919 * take effect sooner (in less frame durations) than others.</p>
3920 * <p>While a set of control changes are being propagated, this value
3921 * will be CONVERGING.</p>
3922 * <p>Once it is fully known that a set of control changes have been
3923 * finished propagating, and the resulting updated control settings
3924 * have been read back by the camera device, this value will be set
3925 * to a non-negative frame number (corresponding to the request to
3926 * which the results have synchronized to).</p>
3927 * <p>Older camera device implementations may not have a way to detect
3928 * when all camera controls have been applied, and will always set this
3929 * value to UNKNOWN.</p>
3930 * <p>FULL capability devices will always have this value set to the
3931 * frame number of the request corresponding to this result.</p>
3932 * <p><em>Further details</em>:</p>
3933 * <ul>
3934 * <li>Whenever a request differs from the last request, any future
3935 * results not yet returned may have this value set to CONVERGING (this
3936 * could include any in-progress captures not yet returned by the camera
3937 * device, for more details see pipeline considerations below).</li>
3938 * <li>Submitting a series of multiple requests that differ from the
3939 * previous request (e.g. r1, r2, r3 s.t. r1 != r2 != r3)
3940 * moves the new synchronization frame to the last non-repeating
3941 * request (using the smallest frame number from the contiguous list of
3942 * repeating requests).</li>
3943 * <li>Submitting the same request repeatedly will not change this value
3944 * to CONVERGING, if it was already a non-negative value.</li>
3945 * <li>When this value changes to non-negative, that means that all of the
3946 * metadata controls from the request have been applied, all of the
3947 * metadata controls from the camera device have been read to the
3948 * updated values (into the result), and all of the graphics buffers
3949 * corresponding to this result are also synchronized to the request.</li>
3950 * </ul>
3951 * <p><em>Pipeline considerations</em>:</p>
3952 * <p>Submitting a request with updated controls relative to the previously
3953 * submitted requests may also invalidate the synchronization state
3954 * of all the results corresponding to currently in-flight requests.</p>
3955 * <p>In other words, results for this current request and up to
3956 * {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} prior requests may have their
3957 * android.sync.frameNumber change to CONVERGING.</p>
Eino-Ville Talvalafd3e2892014-10-06 10:23:55 -07003958 * <p><b>Possible values:</b>
3959 * <ul>
3960 * <li>{@link #SYNC_FRAME_NUMBER_CONVERGING CONVERGING}</li>
3961 * <li>{@link #SYNC_FRAME_NUMBER_UNKNOWN UNKNOWN}</li>
3962 * </ul></p>
3963 * <p><b>Available values for this device:</b><br>
3964 * Either a non-negative value corresponding to a
3965 * <code>frame_number</code>, or one of the two enums (CONVERGING / UNKNOWN).</p>
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07003966 * <p>This key is available on all devices.</p>
Igor Murashkin3865a842014-01-17 18:18:39 -08003967 *
3968 * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
3969 * @see #SYNC_FRAME_NUMBER_CONVERGING
3970 * @see #SYNC_FRAME_NUMBER_UNKNOWN
3971 * @hide
3972 */
Zhijun He4f91e2a2014-04-17 13:20:21 -07003973 public static final Key<Long> SYNC_FRAME_NUMBER =
3974 new Key<Long>("android.sync.frameNumber", long.class);
Igor Murashkin3865a842014-01-17 18:18:39 -08003975
Zhijun He0e99c222015-01-29 15:26:05 -08003976 /**
3977 * <p>The amount of exposure time increase factor applied to the original output
3978 * frame by the application processing before sending for reprocessing.</p>
3979 * <p>This is optional, and will be supported if the camera device supports YUV_REPROCESSING
3980 * capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains YUV_REPROCESSING).</p>
3981 * <p>For some YUV reprocessing use cases, the application may choose to filter the original
3982 * output frames to effectively reduce the noise to the same level as a frame that was
3983 * captured with longer exposure time. To be more specific, assuming the original captured
3984 * images were captured with a sensitivity of S and an exposure time of T, the model in
3985 * the camera device is that the amount of noise in the image would be approximately what
3986 * would be expected if the original capture parameters had been a sensitivity of
3987 * S/effectiveExposureFactor and an exposure time of T*effectiveExposureFactor, rather
3988 * than S and T respectively. If the captured images were processed by the application
3989 * before being sent for reprocessing, then the application may have used image processing
3990 * algorithms and/or multi-frame image fusion to reduce the noise in the
3991 * application-processed images (input images). By using the effectiveExposureFactor
3992 * control, the application can communicate to the camera device the actual noise level
3993 * improvement in the application-processed image. With this information, the camera
3994 * device can select appropriate noise reduction and edge enhancement parameters to avoid
3995 * excessive noise reduction ({@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode}) and insufficient edge
3996 * enhancement ({@link CaptureRequest#EDGE_MODE android.edge.mode}) being applied to the reprocessed frames.</p>
3997 * <p>For example, for multi-frame image fusion use case, the application may fuse
3998 * multiple output frames together to a final frame for reprocessing. When N image are
3999 * fused into 1 image for reprocessing, the exposure time increase factor could be up to
4000 * square root of N (based on a simple photon shot noise model). The camera device will
4001 * adjust the reprocessing noise reduction and edge enhancement parameters accordingly to
4002 * produce the best quality images.</p>
4003 * <p>This is relative factor, 1.0 indicates the application hasn't processed the input
4004 * buffer in a way that affects its effective exposure time.</p>
4005 * <p>This control is only effective for YUV reprocessing capture request. For noise
4006 * reduction reprocessing, it is only effective when <code>{@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode} != OFF</code>.
4007 * Similarly, for edge enhancement reprocessing, it is only effective when
4008 * <code>{@link CaptureRequest#EDGE_MODE android.edge.mode} != OFF</code>.</p>
4009 * <p><b>Units</b>: Relative exposure time increase factor.</p>
4010 * <p><b>Range of valid values:</b><br>
4011 * &gt;= 1.0</p>
4012 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Zhijun He513f7c32015-04-24 18:23:54 -07004013 * <p><b>Limited capability</b> -
4014 * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
4015 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
Zhijun He0e99c222015-01-29 15:26:05 -08004016 *
4017 * @see CaptureRequest#EDGE_MODE
Zhijun He513f7c32015-04-24 18:23:54 -07004018 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Zhijun He0e99c222015-01-29 15:26:05 -08004019 * @see CaptureRequest#NOISE_REDUCTION_MODE
4020 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
4021 */
4022 @PublicKey
4023 public static final Key<Float> REPROCESS_EFFECTIVE_EXPOSURE_FACTOR =
4024 new Key<Float>("android.reprocess.effectiveExposureFactor", float.class);
4025
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -07004026 /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
4027 * End generated code
4028 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
Igor Murashkin6c76f582014-07-15 17:19:49 -07004029
Igor Murashkin4b8cd6b2014-10-02 16:00:52 -07004030
4031
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08004032}