Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 1 | /* |
| 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 Talvala | 2f1a2e4 | 2013-07-25 17:12:05 -0700 | [diff] [blame] | 17 | package android.hardware.camera2; |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 18 | |
Eino-Ville Talvala | 8b90557 | 2015-05-14 15:43:01 -0700 | [diff] [blame] | 19 | import android.annotation.NonNull; |
| 20 | import android.annotation.Nullable; |
Mathew Inwood | bcbe440 | 2018-08-08 15:42:59 +0100 | [diff] [blame^] | 21 | import android.annotation.UnsupportedAppUsage; |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 22 | import android.hardware.camera2.impl.CameraMetadataNative; |
Igor Murashkin | bdf366c | 2014-07-25 16:54:20 -0700 | [diff] [blame] | 23 | import android.hardware.camera2.impl.CaptureResultExtras; |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 24 | import android.hardware.camera2.impl.PublicKey; |
| 25 | import android.hardware.camera2.impl.SyntheticKey; |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame] | 26 | import android.hardware.camera2.utils.TypeReference; |
| 27 | import android.util.Log; |
Igor Murashkin | 72f9f0a | 2014-05-14 15:46:10 -0700 | [diff] [blame] | 28 | import android.util.Rational; |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 29 | |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame] | 30 | import java.util.List; |
| 31 | |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 32 | /** |
Igor Murashkin | db075af | 2014-05-21 10:07:08 -0700 | [diff] [blame] | 33 | * <p>The subset of the results of a single image capture from the image sensor.</p> |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 34 | * |
Igor Murashkin | db075af | 2014-05-21 10:07:08 -0700 | [diff] [blame] | 35 | * <p>Contains a subset of the final configuration for the capture hardware (sensor, lens, |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 36 | * flash), the processing pipeline, the control algorithms, and the output |
| 37 | * buffers.</p> |
| 38 | * |
| 39 | * <p>CaptureResults are produced by a {@link CameraDevice} after processing a |
| 40 | * {@link CaptureRequest}. All properties listed for capture requests can also |
| 41 | * be queried on the capture result, to determine the final values used for |
| 42 | * capture. The result also includes additional metadata about the state of the |
| 43 | * camera device during the capture.</p> |
| 44 | * |
Igor Murashkin | db075af | 2014-05-21 10:07:08 -0700 | [diff] [blame] | 45 | * <p>Not all properties returned by {@link CameraCharacteristics#getAvailableCaptureResultKeys()} |
| 46 | * are necessarily available. Some results are {@link CaptureResult partial} and will |
| 47 | * not have every key set. Only {@link TotalCaptureResult total} results are guaranteed to have |
| 48 | * every key available that was enabled by the request.</p> |
| 49 | * |
| 50 | * <p>{@link CaptureResult} objects are immutable.</p> |
Ruben Brunk | f967a54 | 2014-04-28 16:31:11 -0700 | [diff] [blame] | 51 | * |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 52 | */ |
Igor Murashkin | db075af | 2014-05-21 10:07:08 -0700 | [diff] [blame] | 53 | public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame] | 54 | |
| 55 | private static final String TAG = "CaptureResult"; |
| 56 | private static final boolean VERBOSE = false; |
| 57 | |
| 58 | /** |
| 59 | * A {@code Key} is used to do capture result field lookups with |
| 60 | * {@link CaptureResult#get}. |
| 61 | * |
| 62 | * <p>For example, to get the timestamp corresponding to the exposure of the first row: |
| 63 | * <code><pre> |
| 64 | * long timestamp = captureResult.get(CaptureResult.SENSOR_TIMESTAMP); |
| 65 | * </pre></code> |
| 66 | * </p> |
| 67 | * |
| 68 | * <p>To enumerate over all possible keys for {@link CaptureResult}, see |
| 69 | * {@link CameraCharacteristics#getAvailableCaptureResultKeys}.</p> |
| 70 | * |
| 71 | * @see CaptureResult#get |
| 72 | * @see CameraCharacteristics#getAvailableCaptureResultKeys |
| 73 | */ |
| 74 | public final static class Key<T> { |
| 75 | private final CameraMetadataNative.Key<T> mKey; |
| 76 | |
| 77 | /** |
| 78 | * Visible for testing and vendor extensions only. |
| 79 | * |
| 80 | * @hide |
| 81 | */ |
Mathew Inwood | bcbe440 | 2018-08-08 15:42:59 +0100 | [diff] [blame^] | 82 | @UnsupportedAppUsage |
Emilian Peev | de62d84 | 2017-03-23 19:20:40 +0000 | [diff] [blame] | 83 | public Key(String name, Class<T> type, long vendorId) { |
| 84 | mKey = new CameraMetadataNative.Key<T>(name, type, vendorId); |
| 85 | } |
| 86 | |
| 87 | /** |
| 88 | * Visible for testing and vendor extensions only. |
| 89 | * |
| 90 | * @hide |
| 91 | */ |
Justin Yun | f01e40c | 2018-05-18 20:39:45 +0900 | [diff] [blame] | 92 | public Key(String name, String fallbackName, Class<T> type) { |
| 93 | mKey = new CameraMetadataNative.Key<T>(name, fallbackName, type); |
| 94 | } |
| 95 | |
| 96 | /** |
| 97 | * Visible for testing and vendor extensions only. |
| 98 | * |
| 99 | * @hide |
| 100 | */ |
Mathew Inwood | bcbe440 | 2018-08-08 15:42:59 +0100 | [diff] [blame^] | 101 | @UnsupportedAppUsage |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame] | 102 | public Key(String name, Class<T> type) { |
| 103 | mKey = new CameraMetadataNative.Key<T>(name, type); |
| 104 | } |
| 105 | |
| 106 | /** |
| 107 | * Visible for testing and vendor extensions only. |
| 108 | * |
| 109 | * @hide |
| 110 | */ |
Mathew Inwood | bcbe440 | 2018-08-08 15:42:59 +0100 | [diff] [blame^] | 111 | @UnsupportedAppUsage |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame] | 112 | public Key(String name, TypeReference<T> typeReference) { |
| 113 | mKey = new CameraMetadataNative.Key<T>(name, typeReference); |
| 114 | } |
| 115 | |
| 116 | /** |
| 117 | * Return a camelCase, period separated name formatted like: |
| 118 | * {@code "root.section[.subsections].name"}. |
| 119 | * |
| 120 | * <p>Built-in keys exposed by the Android SDK are always prefixed with {@code "android."}; |
| 121 | * keys that are device/platform-specific are prefixed with {@code "com."}.</p> |
| 122 | * |
| 123 | * <p>For example, {@code CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP} would |
| 124 | * have a name of {@code "android.scaler.streamConfigurationMap"}; whereas a device |
| 125 | * specific key might look like {@code "com.google.nexus.data.private"}.</p> |
| 126 | * |
| 127 | * @return String representation of the key name |
| 128 | */ |
Eino-Ville Talvala | 8b90557 | 2015-05-14 15:43:01 -0700 | [diff] [blame] | 129 | @NonNull |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame] | 130 | public String getName() { |
| 131 | return mKey.getName(); |
| 132 | } |
| 133 | |
| 134 | /** |
Emilian Peev | de62d84 | 2017-03-23 19:20:40 +0000 | [diff] [blame] | 135 | * Return vendor tag id. |
| 136 | * |
| 137 | * @hide |
| 138 | */ |
| 139 | public long getVendorId() { |
| 140 | return mKey.getVendorId(); |
| 141 | } |
| 142 | |
| 143 | /** |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame] | 144 | * {@inheritDoc} |
| 145 | */ |
| 146 | @Override |
| 147 | public final int hashCode() { |
| 148 | return mKey.hashCode(); |
| 149 | } |
| 150 | |
| 151 | /** |
| 152 | * {@inheritDoc} |
| 153 | */ |
| 154 | @SuppressWarnings("unchecked") |
| 155 | @Override |
| 156 | public final boolean equals(Object o) { |
| 157 | return o instanceof Key && ((Key<T>)o).mKey.equals(mKey); |
| 158 | } |
| 159 | |
| 160 | /** |
Chien-Yu Chen | 12a8385 | 2015-07-07 12:17:22 -0700 | [diff] [blame] | 161 | * Return this {@link Key} as a string representation. |
| 162 | * |
| 163 | * <p>{@code "CaptureResult.Key(%s)"}, where {@code %s} represents |
| 164 | * the name of this key as returned by {@link #getName}.</p> |
| 165 | * |
| 166 | * @return string representation of {@link Key} |
| 167 | */ |
| 168 | @NonNull |
| 169 | @Override |
| 170 | public String toString() { |
| 171 | return String.format("CaptureResult.Key(%s)", mKey.getName()); |
| 172 | } |
| 173 | |
| 174 | /** |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame] | 175 | * Visible for CameraMetadataNative implementation only; do not use. |
| 176 | * |
| 177 | * TODO: Make this private or remove it altogether. |
| 178 | * |
| 179 | * @hide |
| 180 | */ |
Mathew Inwood | bcbe440 | 2018-08-08 15:42:59 +0100 | [diff] [blame^] | 181 | @UnsupportedAppUsage |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame] | 182 | public CameraMetadataNative.Key<T> getNativeKey() { |
| 183 | return mKey; |
| 184 | } |
| 185 | |
| 186 | @SuppressWarnings({ "unchecked" }) |
| 187 | /*package*/ Key(CameraMetadataNative.Key<?> nativeKey) { |
| 188 | mKey = (CameraMetadataNative.Key<T>) nativeKey; |
| 189 | } |
| 190 | } |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 191 | |
Mathew Inwood | bcbe440 | 2018-08-08 15:42:59 +0100 | [diff] [blame^] | 192 | @UnsupportedAppUsage |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 193 | private final CameraMetadataNative mResults; |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 194 | private final CaptureRequest mRequest; |
| 195 | private final int mSequenceId; |
Igor Murashkin | bdf366c | 2014-07-25 16:54:20 -0700 | [diff] [blame] | 196 | private final long mFrameNumber; |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 197 | |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 198 | /** |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 199 | * Takes ownership of the passed-in properties object |
Igor Murashkin | bdf366c | 2014-07-25 16:54:20 -0700 | [diff] [blame] | 200 | * |
| 201 | * <p>For internal use only</p> |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 202 | * @hide |
| 203 | */ |
Igor Murashkin | bdf366c | 2014-07-25 16:54:20 -0700 | [diff] [blame] | 204 | public CaptureResult(CameraMetadataNative results, CaptureRequest parent, |
| 205 | CaptureResultExtras extras) { |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 206 | if (results == null) { |
| 207 | throw new IllegalArgumentException("results was null"); |
| 208 | } |
| 209 | |
| 210 | if (parent == null) { |
| 211 | throw new IllegalArgumentException("parent was null"); |
| 212 | } |
| 213 | |
Igor Murashkin | bdf366c | 2014-07-25 16:54:20 -0700 | [diff] [blame] | 214 | if (extras == null) { |
| 215 | throw new IllegalArgumentException("extras was null"); |
| 216 | } |
| 217 | |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame] | 218 | mResults = CameraMetadataNative.move(results); |
| 219 | if (mResults.isEmpty()) { |
| 220 | throw new AssertionError("Results must not be empty"); |
| 221 | } |
Emilian Peev | de62d84 | 2017-03-23 19:20:40 +0000 | [diff] [blame] | 222 | setNativeInstance(mResults); |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 223 | mRequest = parent; |
Igor Murashkin | bdf366c | 2014-07-25 16:54:20 -0700 | [diff] [blame] | 224 | mSequenceId = extras.getRequestId(); |
| 225 | mFrameNumber = extras.getFrameNumber(); |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 226 | } |
| 227 | |
Ruben Brunk | f967a54 | 2014-04-28 16:31:11 -0700 | [diff] [blame] | 228 | /** |
| 229 | * Returns a copy of the underlying {@link CameraMetadataNative}. |
| 230 | * @hide |
| 231 | */ |
| 232 | public CameraMetadataNative getNativeCopy() { |
| 233 | return new CameraMetadataNative(mResults); |
| 234 | } |
| 235 | |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame] | 236 | /** |
| 237 | * Creates a request-less result. |
| 238 | * |
| 239 | * <p><strong>For testing only.</strong></p> |
| 240 | * @hide |
| 241 | */ |
| 242 | public CaptureResult(CameraMetadataNative results, int sequenceId) { |
| 243 | if (results == null) { |
| 244 | throw new IllegalArgumentException("results was null"); |
| 245 | } |
| 246 | |
| 247 | mResults = CameraMetadataNative.move(results); |
| 248 | if (mResults.isEmpty()) { |
| 249 | throw new AssertionError("Results must not be empty"); |
| 250 | } |
| 251 | |
Emilian Peev | de62d84 | 2017-03-23 19:20:40 +0000 | [diff] [blame] | 252 | setNativeInstance(mResults); |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame] | 253 | mRequest = null; |
| 254 | mSequenceId = sequenceId; |
Igor Murashkin | bdf366c | 2014-07-25 16:54:20 -0700 | [diff] [blame] | 255 | mFrameNumber = -1; |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame] | 256 | } |
| 257 | |
| 258 | /** |
| 259 | * Get a capture result field value. |
| 260 | * |
| 261 | * <p>The field definitions can be found in {@link CaptureResult}.</p> |
| 262 | * |
| 263 | * <p>Querying the value for the same key more than once will return a value |
| 264 | * which is equal to the previous queried value.</p> |
| 265 | * |
| 266 | * @throws IllegalArgumentException if the key was not valid |
| 267 | * |
| 268 | * @param key The result field to read. |
| 269 | * @return The value of that key, or {@code null} if the field is not set. |
| 270 | */ |
Eino-Ville Talvala | 8b90557 | 2015-05-14 15:43:01 -0700 | [diff] [blame] | 271 | @Nullable |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 272 | public <T> T get(Key<T> key) { |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame] | 273 | T value = mResults.get(key); |
| 274 | if (VERBOSE) Log.v(TAG, "#get for Key = " + key.getName() + ", returned value = " + value); |
| 275 | return value; |
| 276 | } |
| 277 | |
| 278 | /** |
| 279 | * {@inheritDoc} |
| 280 | * @hide |
| 281 | */ |
| 282 | @SuppressWarnings("unchecked") |
| 283 | @Override |
| 284 | protected <T> T getProtected(Key<?> key) { |
| 285 | return (T) mResults.get(key); |
| 286 | } |
| 287 | |
| 288 | /** |
| 289 | * {@inheritDoc} |
| 290 | * @hide |
| 291 | */ |
| 292 | @SuppressWarnings("unchecked") |
| 293 | @Override |
| 294 | protected Class<Key<?>> getKeyClass() { |
| 295 | Object thisClass = Key.class; |
| 296 | return (Class<Key<?>>)thisClass; |
| 297 | } |
| 298 | |
| 299 | /** |
| 300 | * Dumps the native metadata contents to logcat. |
| 301 | * |
| 302 | * <p>Visibility for testing/debugging only. The results will not |
| 303 | * include any synthesized keys, as they are invisible to the native layer.</p> |
| 304 | * |
| 305 | * @hide |
| 306 | */ |
| 307 | public void dumpToLog() { |
| 308 | mResults.dumpToLog(); |
| 309 | } |
| 310 | |
| 311 | /** |
| 312 | * {@inheritDoc} |
| 313 | */ |
| 314 | @Override |
Eino-Ville Talvala | 8b90557 | 2015-05-14 15:43:01 -0700 | [diff] [blame] | 315 | @NonNull |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame] | 316 | public List<Key<?>> getKeys() { |
| 317 | // Force the javadoc for this function to show up on the CaptureResult page |
| 318 | return super.getKeys(); |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 319 | } |
| 320 | |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 321 | /** |
| 322 | * Get the request associated with this result. |
| 323 | * |
Igor Murashkin | db075af | 2014-05-21 10:07:08 -0700 | [diff] [blame] | 324 | * <p>Whenever a request has been fully or partially captured, with |
Eino-Ville Talvala | fd88743 | 2014-09-04 13:07:40 -0700 | [diff] [blame] | 325 | * {@link CameraCaptureSession.CaptureCallback#onCaptureCompleted} or |
| 326 | * {@link CameraCaptureSession.CaptureCallback#onCaptureProgressed}, the {@code result}'s |
Igor Murashkin | db075af | 2014-05-21 10:07:08 -0700 | [diff] [blame] | 327 | * {@code getRequest()} will return that {@code request}. |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 328 | * </p> |
| 329 | * |
Igor Murashkin | db075af | 2014-05-21 10:07:08 -0700 | [diff] [blame] | 330 | * <p>For example, |
Eino-Ville Talvala | fd88743 | 2014-09-04 13:07:40 -0700 | [diff] [blame] | 331 | * <code><pre>cameraDevice.capture(someRequest, new CaptureCallback() { |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 332 | * {@literal @}Override |
| 333 | * void onCaptureCompleted(CaptureRequest myRequest, CaptureResult myResult) { |
| 334 | * assert(myResult.getRequest.equals(myRequest) == true); |
| 335 | * } |
Igor Murashkin | db075af | 2014-05-21 10:07:08 -0700 | [diff] [blame] | 336 | * }, null); |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 337 | * </code></pre> |
| 338 | * </p> |
| 339 | * |
| 340 | * @return The request associated with this result. Never {@code null}. |
| 341 | */ |
Eino-Ville Talvala | 8b90557 | 2015-05-14 15:43:01 -0700 | [diff] [blame] | 342 | @NonNull |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 343 | public CaptureRequest getRequest() { |
| 344 | return mRequest; |
| 345 | } |
| 346 | |
| 347 | /** |
| 348 | * Get the frame number associated with this result. |
| 349 | * |
| 350 | * <p>Whenever a request has been processed, regardless of failure or success, |
| 351 | * it gets a unique frame number assigned to its future result/failure.</p> |
| 352 | * |
Chien-Yu Chen | 5398a67 | 2015-03-19 14:48:43 -0700 | [diff] [blame] | 353 | * <p>For the same type of request (capturing from the camera device or reprocessing), this |
| 354 | * value monotonically increments, starting with 0, for every new result or failure and the |
| 355 | * scope is the lifetime of the {@link CameraDevice}. Between different types of requests, |
| 356 | * the frame number may not monotonically increment. For example, the frame number of a newer |
| 357 | * reprocess result may be smaller than the frame number of an older result of capturing new |
| 358 | * images from the camera device, but the frame number of a newer reprocess result will never be |
| 359 | * smaller than the frame number of an older reprocess result.</p> |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 360 | * |
Igor Murashkin | bdf366c | 2014-07-25 16:54:20 -0700 | [diff] [blame] | 361 | * @return The frame number |
Chien-Yu Chen | 5398a67 | 2015-03-19 14:48:43 -0700 | [diff] [blame] | 362 | * |
| 363 | * @see CameraDevice#createCaptureRequest |
| 364 | * @see CameraDevice#createReprocessCaptureRequest |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 365 | */ |
Igor Murashkin | bdf366c | 2014-07-25 16:54:20 -0700 | [diff] [blame] | 366 | public long getFrameNumber() { |
| 367 | return mFrameNumber; |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 368 | } |
| 369 | |
| 370 | /** |
| 371 | * The sequence ID for this failure that was returned by the |
Eino-Ville Talvala | 0a160ac | 2014-07-02 14:29:26 -0700 | [diff] [blame] | 372 | * {@link CameraCaptureSession#capture} family of functions. |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 373 | * |
| 374 | * <p>The sequence ID is a unique monotonically increasing value starting from 0, |
| 375 | * incremented every time a new group of requests is submitted to the CameraDevice.</p> |
| 376 | * |
| 377 | * @return int The ID for the sequence of requests that this capture result is a part of |
| 378 | * |
Aurimas Liutikas | dc309f2 | 2018-06-04 15:35:31 -0700 | [diff] [blame] | 379 | * @see CameraCaptureSession.CaptureCallback#onCaptureSequenceCompleted |
| 380 | * @see CameraCaptureSession.CaptureCallback#onCaptureSequenceAborted |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 381 | */ |
| 382 | public int getSequenceId() { |
| 383 | return mSequenceId; |
| 384 | } |
| 385 | |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 386 | /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ |
| 387 | * The key entries below this point are generated from metadata |
| 388 | * definitions in /system/media/camera/docs. Do not modify by hand or |
| 389 | * modify the comment blocks at the start or end. |
| 390 | *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/ |
| 391 | |
| 392 | /** |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 393 | * <p>The mode control selects how the image data is converted from the |
| 394 | * sensor's native color into linear sRGB color.</p> |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 395 | * <p>When auto-white balance (AWB) is enabled with {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, this |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 396 | * control is overridden by the AWB routine. When AWB is disabled, the |
| 397 | * application controls how the color mapping is performed.</p> |
| 398 | * <p>We define the expected processing pipeline below. For consistency |
| 399 | * across devices, this is always the case with TRANSFORM_MATRIX.</p> |
| 400 | * <p>When either FULL or HIGH_QUALITY is used, the camera device may |
| 401 | * do additional processing but {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and |
| 402 | * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} will still be provided by the |
| 403 | * camera device (in the results) and be roughly correct.</p> |
| 404 | * <p>Switching to TRANSFORM_MATRIX and using the data provided from |
| 405 | * FAST or HIGH_QUALITY will yield a picture with the same white point |
| 406 | * as what was produced by the camera device in the earlier frame.</p> |
| 407 | * <p>The expected processing pipeline is as follows:</p> |
Eino-Ville Talvala | 9dc7ec1 | 2017-11-10 15:23:00 -0800 | [diff] [blame] | 408 | * <p><img alt="White balance processing pipeline" src="/reference/images/camera2/metadata/android.colorCorrection.mode/processing_pipeline.png" /></p> |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 409 | * <p>The white balance is encoded by two values, a 4-channel white-balance |
| 410 | * gain vector (applied in the Bayer domain), and a 3x3 color transform |
| 411 | * matrix (applied after demosaic).</p> |
| 412 | * <p>The 4-channel white-balance gains are defined as:</p> |
| 413 | * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} = [ R G_even G_odd B ] |
| 414 | * </code></pre> |
| 415 | * <p>where <code>G_even</code> is the gain for green pixels on even rows of the |
| 416 | * output, and <code>G_odd</code> is the gain for green pixels on the odd rows. |
| 417 | * These may be identical for a given camera device implementation; if |
| 418 | * the camera device does not support a separate gain for even/odd green |
| 419 | * channels, it will use the <code>G_even</code> value, and write <code>G_odd</code> equal to |
| 420 | * <code>G_even</code> in the output result metadata.</p> |
| 421 | * <p>The matrices for color transforms are defined as a 9-entry vector:</p> |
| 422 | * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} = [ I0 I1 I2 I3 I4 I5 I6 I7 I8 ] |
| 423 | * </code></pre> |
| 424 | * <p>which define a transform from input sensor colors, <code>P_in = [ r g b ]</code>, |
| 425 | * to output linear sRGB, <code>P_out = [ r' g' b' ]</code>,</p> |
| 426 | * <p>with colors as follows:</p> |
| 427 | * <pre><code>r' = I0r + I1g + I2b |
| 428 | * g' = I3r + I4g + I5b |
| 429 | * b' = I6r + I7g + I8b |
| 430 | * </code></pre> |
| 431 | * <p>Both the input and output value ranges must match. Overflow/underflow |
| 432 | * values are clipped to fit within the range.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 433 | * <p><b>Possible values:</b> |
| 434 | * <ul> |
| 435 | * <li>{@link #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX TRANSFORM_MATRIX}</li> |
| 436 | * <li>{@link #COLOR_CORRECTION_MODE_FAST FAST}</li> |
| 437 | * <li>{@link #COLOR_CORRECTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li> |
| 438 | * </ul></p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 439 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 440 | * <p><b>Full capability</b> - |
| 441 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 442 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 443 | * |
| 444 | * @see CaptureRequest#COLOR_CORRECTION_GAINS |
| 445 | * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM |
| 446 | * @see CaptureRequest#CONTROL_AWB_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 447 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 448 | * @see #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX |
| 449 | * @see #COLOR_CORRECTION_MODE_FAST |
| 450 | * @see #COLOR_CORRECTION_MODE_HIGH_QUALITY |
| 451 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 452 | @PublicKey |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 453 | public static final Key<Integer> COLOR_CORRECTION_MODE = |
| 454 | new Key<Integer>("android.colorCorrection.mode", int.class); |
| 455 | |
| 456 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 457 | * <p>A color transform matrix to use to transform |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 458 | * from sensor RGB color space to output linear sRGB color space.</p> |
Zhijun He | 49a3ca9 | 2014-02-05 13:48:09 -0800 | [diff] [blame] | 459 | * <p>This matrix is either set by the camera device when the request |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 460 | * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 461 | * directly by the application in the request when the |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 462 | * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p> |
Zhijun He | 49a3ca9 | 2014-02-05 13:48:09 -0800 | [diff] [blame] | 463 | * <p>In the latter case, the camera device may round the matrix to account |
| 464 | * for precision issues; the final rounded matrix should be reported back |
| 465 | * in this matrix result metadata. The transform should keep the magnitude |
| 466 | * of the output color values within <code>[0, 1.0]</code> (assuming input color |
| 467 | * values is within the normalized range <code>[0, 1.0]</code>), or clipping may occur.</p> |
Yin-Chia Yeh | d9fc67c | 2015-01-30 10:47:22 -0800 | [diff] [blame] | 468 | * <p>The valid range of each matrix element varies on different devices, but |
| 469 | * values within [-1.5, 3.0] are guaranteed not to be clipped.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 470 | * <p><b>Units</b>: Unitless scale factors</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 471 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 472 | * <p><b>Full capability</b> - |
| 473 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 474 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 475 | * |
| 476 | * @see CaptureRequest#COLOR_CORRECTION_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 477 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 478 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 479 | @PublicKey |
Eino-Ville Talvala | 2bb91a7 | 2014-05-27 18:16:53 -0700 | [diff] [blame] | 480 | public static final Key<android.hardware.camera2.params.ColorSpaceTransform> COLOR_CORRECTION_TRANSFORM = |
| 481 | new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.colorCorrection.transform", android.hardware.camera2.params.ColorSpaceTransform.class); |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 482 | |
| 483 | /** |
Igor Murashkin | 7d2a5c5 | 2014-01-17 15:07:52 -0800 | [diff] [blame] | 484 | * <p>Gains applying to Bayer raw color channels for |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 485 | * white-balance.</p> |
Eino-Ville Talvala | 2bb91a7 | 2014-05-27 18:16:53 -0700 | [diff] [blame] | 486 | * <p>These per-channel gains are either set by the camera device |
| 487 | * when the request {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not |
| 488 | * TRANSFORM_MATRIX, or directly by the application in the |
| 489 | * request when the {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is |
| 490 | * TRANSFORM_MATRIX.</p> |
| 491 | * <p>The gains in the result metadata are the gains actually |
| 492 | * applied by the camera device to the current frame.</p> |
Yin-Chia Yeh | d9fc67c | 2015-01-30 10:47:22 -0800 | [diff] [blame] | 493 | * <p>The valid range of gains varies on different devices, but gains |
| 494 | * between [1.0, 3.0] are guaranteed not to be clipped. Even if a given |
| 495 | * device allows gains below 1.0, this is usually not recommended because |
| 496 | * this can create color artifacts.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 497 | * <p><b>Units</b>: Unitless gain factors</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 498 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 499 | * <p><b>Full capability</b> - |
| 500 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 501 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 502 | * |
| 503 | * @see CaptureRequest#COLOR_CORRECTION_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 504 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 505 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 506 | @PublicKey |
Eino-Ville Talvala | 2bb91a7 | 2014-05-27 18:16:53 -0700 | [diff] [blame] | 507 | public static final Key<android.hardware.camera2.params.RggbChannelVector> COLOR_CORRECTION_GAINS = |
| 508 | new Key<android.hardware.camera2.params.RggbChannelVector>("android.colorCorrection.gains", android.hardware.camera2.params.RggbChannelVector.class); |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 509 | |
| 510 | /** |
Zhijun He | a05e59d | 2014-07-08 18:27:47 -0700 | [diff] [blame] | 511 | * <p>Mode of operation for the chromatic aberration correction algorithm.</p> |
Zhijun He | a05e59d | 2014-07-08 18:27:47 -0700 | [diff] [blame] | 512 | * <p>Chromatic (color) aberration is caused by the fact that different wavelengths of light |
| 513 | * can not focus on the same point after exiting from the lens. This metadata defines |
| 514 | * the high level control of chromatic aberration correction algorithm, which aims to |
| 515 | * minimize the chromatic artifacts that may occur along the object boundaries in an |
| 516 | * image.</p> |
| 517 | * <p>FAST/HIGH_QUALITY both mean that camera device determined aberration |
| 518 | * correction will be applied. HIGH_QUALITY mode indicates that the camera device will |
| 519 | * use the highest-quality aberration correction algorithms, even if it slows down |
| 520 | * capture rate. FAST means the camera device will not slow down capture rate when |
| 521 | * applying aberration correction.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 522 | * <p>LEGACY devices will always be in FAST mode.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 523 | * <p><b>Possible values:</b> |
| 524 | * <ul> |
| 525 | * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_OFF OFF}</li> |
| 526 | * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_FAST FAST}</li> |
| 527 | * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY HIGH_QUALITY}</li> |
| 528 | * </ul></p> |
| 529 | * <p><b>Available values for this device:</b><br> |
| 530 | * {@link CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES android.colorCorrection.availableAberrationModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 531 | * <p>This key is available on all devices.</p> |
Zhijun He | a05e59d | 2014-07-08 18:27:47 -0700 | [diff] [blame] | 532 | * |
Zhijun He | 9e4e439 | 2014-08-18 11:12:32 -0700 | [diff] [blame] | 533 | * @see CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES |
| 534 | * @see #COLOR_CORRECTION_ABERRATION_MODE_OFF |
| 535 | * @see #COLOR_CORRECTION_ABERRATION_MODE_FAST |
| 536 | * @see #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY |
Zhijun He | a05e59d | 2014-07-08 18:27:47 -0700 | [diff] [blame] | 537 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 538 | @PublicKey |
Zhijun He | 9e4e439 | 2014-08-18 11:12:32 -0700 | [diff] [blame] | 539 | public static final Key<Integer> COLOR_CORRECTION_ABERRATION_MODE = |
| 540 | new Key<Integer>("android.colorCorrection.aberrationMode", int.class); |
Zhijun He | a05e59d | 2014-07-08 18:27:47 -0700 | [diff] [blame] | 541 | |
| 542 | /** |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 543 | * <p>The desired setting for the camera device's auto-exposure |
| 544 | * algorithm's antibanding compensation.</p> |
| 545 | * <p>Some kinds of lighting fixtures, such as some fluorescent |
| 546 | * lights, flicker at the rate of the power supply frequency |
| 547 | * (60Hz or 50Hz, depending on country). While this is |
| 548 | * typically not noticeable to a person, it can be visible to |
| 549 | * a camera device. If a camera sets its exposure time to the |
| 550 | * wrong value, the flicker may become visible in the |
| 551 | * viewfinder as flicker or in a final captured image, as a |
| 552 | * set of variable-brightness bands across the image.</p> |
| 553 | * <p>Therefore, the auto-exposure routines of camera devices |
| 554 | * include antibanding routines that ensure that the chosen |
| 555 | * exposure value will not cause such banding. The choice of |
| 556 | * exposure time depends on the rate of flicker, which the |
| 557 | * camera device can detect automatically, or the expected |
| 558 | * rate can be selected by the application using this |
| 559 | * control.</p> |
| 560 | * <p>A given camera device may not support all of the possible |
| 561 | * options for the antibanding mode. The |
| 562 | * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes} key contains |
| 563 | * the available modes for a given camera device.</p> |
Yin-Chia Yeh | 7b2cae6 | 2014-11-25 11:54:18 -0800 | [diff] [blame] | 564 | * <p>AUTO mode is the default if it is available on given |
| 565 | * camera device. When AUTO mode is not available, the |
| 566 | * default will be either 50HZ or 60HZ, and both 50HZ |
| 567 | * and 60HZ will be available.</p> |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 568 | * <p>If manual exposure control is enabled (by setting |
| 569 | * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} to OFF), |
| 570 | * then this setting has no effect, and the application must |
| 571 | * ensure it selects exposure times that do not cause banding |
| 572 | * issues. The {@link CaptureResult#STATISTICS_SCENE_FLICKER android.statistics.sceneFlicker} key can assist |
| 573 | * the application in this.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 574 | * <p><b>Possible values:</b> |
| 575 | * <ul> |
| 576 | * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_OFF OFF}</li> |
| 577 | * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_50HZ 50HZ}</li> |
| 578 | * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_60HZ 60HZ}</li> |
| 579 | * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_AUTO AUTO}</li> |
| 580 | * </ul></p> |
| 581 | * <p><b>Available values for this device:</b><br></p> |
| 582 | * <p>{@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 583 | * <p>This key is available on all devices.</p> |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 584 | * |
| 585 | * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES |
| 586 | * @see CaptureRequest#CONTROL_AE_MODE |
| 587 | * @see CaptureRequest#CONTROL_MODE |
| 588 | * @see CaptureResult#STATISTICS_SCENE_FLICKER |
| 589 | * @see #CONTROL_AE_ANTIBANDING_MODE_OFF |
| 590 | * @see #CONTROL_AE_ANTIBANDING_MODE_50HZ |
| 591 | * @see #CONTROL_AE_ANTIBANDING_MODE_60HZ |
| 592 | * @see #CONTROL_AE_ANTIBANDING_MODE_AUTO |
| 593 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 594 | @PublicKey |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 595 | public static final Key<Integer> CONTROL_AE_ANTIBANDING_MODE = |
| 596 | new Key<Integer>("android.control.aeAntibandingMode", int.class); |
| 597 | |
| 598 | /** |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 599 | * <p>Adjustment to auto-exposure (AE) target image |
| 600 | * brightness.</p> |
| 601 | * <p>The adjustment is measured as a count of steps, with the |
| 602 | * step size defined by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep} and the |
| 603 | * allowed range by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}.</p> |
| 604 | * <p>For example, if the exposure value (EV) step is 0.333, '6' |
| 605 | * will mean an exposure compensation of +2 EV; -3 will mean an |
| 606 | * exposure compensation of -1 EV. One EV represents a doubling |
| 607 | * of image brightness. Note that this control will only be |
| 608 | * effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF. This control |
| 609 | * will take effect even when {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} <code>== true</code>.</p> |
Yin-Chia Yeh | a4227df | 2014-05-05 14:27:39 -0700 | [diff] [blame] | 610 | * <p>In the event of exposure compensation value being changed, camera device |
| 611 | * may take several frames to reach the newly requested exposure target. |
| 612 | * During that time, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} field will be in the SEARCHING |
| 613 | * state. Once the new exposure target is reached, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} will |
| 614 | * change from SEARCHING to either CONVERGED, LOCKED (if AE lock is enabled), or |
| 615 | * FLASH_REQUIRED (if the scene is too dark for still capture).</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 616 | * <p><b>Units</b>: Compensation steps</p> |
| 617 | * <p><b>Range of valid values:</b><br> |
| 618 | * {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 619 | * <p>This key is available on all devices.</p> |
Yin-Chia Yeh | a4227df | 2014-05-05 14:27:39 -0700 | [diff] [blame] | 620 | * |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 621 | * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE |
| 622 | * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP |
Yin-Chia Yeh | a4227df | 2014-05-05 14:27:39 -0700 | [diff] [blame] | 623 | * @see CaptureRequest#CONTROL_AE_LOCK |
| 624 | * @see CaptureRequest#CONTROL_AE_MODE |
| 625 | * @see CaptureResult#CONTROL_AE_STATE |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 626 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 627 | @PublicKey |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 628 | public static final Key<Integer> CONTROL_AE_EXPOSURE_COMPENSATION = |
| 629 | new Key<Integer>("android.control.aeExposureCompensation", int.class); |
| 630 | |
| 631 | /** |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 632 | * <p>Whether auto-exposure (AE) is currently locked to its latest |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 633 | * calculated values.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 634 | * <p>When set to <code>true</code> (ON), the AE algorithm is locked to its latest parameters, |
| 635 | * and will not change exposure settings until the lock is set to <code>false</code> (OFF).</p> |
| 636 | * <p>Note that even when AE is locked, the flash may be fired if |
| 637 | * the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_AUTO_FLASH / |
| 638 | * ON_ALWAYS_FLASH / ON_AUTO_FLASH_REDEYE.</p> |
Yin-Chia Yeh | a4227df | 2014-05-05 14:27:39 -0700 | [diff] [blame] | 639 | * <p>When {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation} is changed, even if the AE lock |
| 640 | * is ON, the camera device will still adjust its exposure value.</p> |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 641 | * <p>If AE precapture is triggered (see {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}) |
| 642 | * when AE is already locked, the camera device will not change the exposure time |
| 643 | * ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}) and sensitivity ({@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}) |
| 644 | * parameters. The flash may be fired if the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} |
| 645 | * is ON_AUTO_FLASH/ON_AUTO_FLASH_REDEYE and the scene is too dark. If the |
Zhijun He | fa95b04 | 2015-02-09 10:40:49 -0800 | [diff] [blame] | 646 | * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_ALWAYS_FLASH, the scene may become overexposed. |
| 647 | * Similarly, AE precapture trigger CANCEL has no effect when AE is already locked.</p> |
| 648 | * <p>When an AE precapture sequence is triggered, AE unlock will not be able to unlock |
| 649 | * the AE if AE is locked by the camera device internally during precapture metering |
| 650 | * sequence In other words, submitting requests with AE unlock has no effect for an |
| 651 | * ongoing precapture metering sequence. Otherwise, the precapture metering sequence |
| 652 | * will never succeed in a sequence of preview requests where AE lock is always set |
| 653 | * to <code>false</code>.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 654 | * <p>Since the camera device has a pipeline of in-flight requests, the settings that |
| 655 | * get locked do not necessarily correspond to the settings that were present in the |
| 656 | * latest capture result received from the camera device, since additional captures |
| 657 | * and AE updates may have occurred even before the result was sent out. If an |
| 658 | * application is switching between automatic and manual control and wishes to eliminate |
| 659 | * any flicker during the switch, the following procedure is recommended:</p> |
| 660 | * <ol> |
| 661 | * <li>Starting in auto-AE mode:</li> |
| 662 | * <li>Lock AE</li> |
| 663 | * <li>Wait for the first result to be output that has the AE locked</li> |
| 664 | * <li>Copy exposure settings from that result into a request, set the request to manual AE</li> |
| 665 | * <li>Submit the capture request, proceed to run manual AE as desired.</li> |
| 666 | * </ol> |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 667 | * <p>See {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE lock related state transition details.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 668 | * <p>This key is available on all devices.</p> |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 669 | * |
Yin-Chia Yeh | a4227df | 2014-05-05 14:27:39 -0700 | [diff] [blame] | 670 | * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 671 | * @see CaptureRequest#CONTROL_AE_MODE |
| 672 | * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER |
| 673 | * @see CaptureResult#CONTROL_AE_STATE |
| 674 | * @see CaptureRequest#SENSOR_EXPOSURE_TIME |
| 675 | * @see CaptureRequest#SENSOR_SENSITIVITY |
| 676 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 677 | @PublicKey |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 678 | public static final Key<Boolean> CONTROL_AE_LOCK = |
| 679 | new Key<Boolean>("android.control.aeLock", boolean.class); |
| 680 | |
| 681 | /** |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 682 | * <p>The desired mode for the camera device's |
| 683 | * auto-exposure routine.</p> |
| 684 | * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is |
| 685 | * AUTO.</p> |
| 686 | * <p>When set to any of the ON modes, the camera device's |
| 687 | * auto-exposure routine is enabled, overriding the |
| 688 | * application's selected exposure time, sensor sensitivity, |
| 689 | * and frame duration ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}, |
| 690 | * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and |
| 691 | * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}). If one of the FLASH modes |
| 692 | * is selected, the camera device's flash unit controls are |
| 693 | * also overridden.</p> |
| 694 | * <p>The FLASH modes are only available if the camera device |
| 695 | * has a flash unit ({@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} is <code>true</code>).</p> |
| 696 | * <p>If flash TORCH mode is desired, this field must be set to |
| 697 | * ON or OFF, and {@link CaptureRequest#FLASH_MODE android.flash.mode} set to TORCH.</p> |
| 698 | * <p>When set to any of the ON modes, the values chosen by the |
| 699 | * camera device auto-exposure routine for the overridden |
| 700 | * fields for a given capture will be available in its |
| 701 | * CaptureResult.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 702 | * <p><b>Possible values:</b> |
| 703 | * <ul> |
| 704 | * <li>{@link #CONTROL_AE_MODE_OFF OFF}</li> |
| 705 | * <li>{@link #CONTROL_AE_MODE_ON ON}</li> |
| 706 | * <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH ON_AUTO_FLASH}</li> |
| 707 | * <li>{@link #CONTROL_AE_MODE_ON_ALWAYS_FLASH ON_ALWAYS_FLASH}</li> |
| 708 | * <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE ON_AUTO_FLASH_REDEYE}</li> |
Chien-Yu Chen | 2cf3357 | 2018-01-11 11:35:41 -0800 | [diff] [blame] | 709 | * <li>{@link #CONTROL_AE_MODE_ON_EXTERNAL_FLASH ON_EXTERNAL_FLASH}</li> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 710 | * </ul></p> |
| 711 | * <p><b>Available values for this device:</b><br> |
| 712 | * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES android.control.aeAvailableModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 713 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 714 | * |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 715 | * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 716 | * @see CaptureRequest#CONTROL_MODE |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 717 | * @see CameraCharacteristics#FLASH_INFO_AVAILABLE |
| 718 | * @see CaptureRequest#FLASH_MODE |
Igor Murashkin | aef3b7e | 2014-01-15 13:20:37 -0800 | [diff] [blame] | 719 | * @see CaptureRequest#SENSOR_EXPOSURE_TIME |
| 720 | * @see CaptureRequest#SENSOR_FRAME_DURATION |
Zhijun He | 399f05d | 2014-01-15 11:31:30 -0800 | [diff] [blame] | 721 | * @see CaptureRequest#SENSOR_SENSITIVITY |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 722 | * @see #CONTROL_AE_MODE_OFF |
| 723 | * @see #CONTROL_AE_MODE_ON |
| 724 | * @see #CONTROL_AE_MODE_ON_AUTO_FLASH |
| 725 | * @see #CONTROL_AE_MODE_ON_ALWAYS_FLASH |
| 726 | * @see #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE |
Chien-Yu Chen | 2cf3357 | 2018-01-11 11:35:41 -0800 | [diff] [blame] | 727 | * @see #CONTROL_AE_MODE_ON_EXTERNAL_FLASH |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 728 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 729 | @PublicKey |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 730 | public static final Key<Integer> CONTROL_AE_MODE = |
| 731 | new Key<Integer>("android.control.aeMode", int.class); |
| 732 | |
| 733 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 734 | * <p>List of metering areas to use for auto-exposure adjustment.</p> |
| 735 | * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe} is 0. |
Yin-Chia Yeh | 808150f | 2014-09-08 15:48:47 -0700 | [diff] [blame] | 736 | * Otherwise will always be present.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 737 | * <p>The maximum number of regions supported by the device is determined by the value |
| 738 | * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe}.</p> |
Yin-Chia Yeh | 6c73e40 | 2018-06-15 15:37:08 -0700 | [diff] [blame] | 739 | * <p>For devices not supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate |
| 740 | * system always follows that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with (0,0) being |
| 741 | * the top-left pixel in the active pixel array, and |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 742 | * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1, |
Yin-Chia Yeh | 6c73e40 | 2018-06-15 15:37:08 -0700 | [diff] [blame] | 743 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the bottom-right pixel in the |
| 744 | * active pixel array.</p> |
| 745 | * <p>For devices supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate |
| 746 | * system depends on the mode being set. |
| 747 | * When the distortion correction mode is OFF, the coordinate system follows |
| 748 | * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, with |
| 749 | * <code>(0, 0)</code> being the top-left pixel of the pre-correction active array, and |
| 750 | * ({@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.width - 1, |
| 751 | * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.height - 1) being the bottom-right |
| 752 | * pixel in the pre-correction active pixel array. |
| 753 | * When the distortion correction mode is not OFF, the coordinate system follows |
| 754 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with |
| 755 | * <code>(0, 0)</code> being the top-left pixel of the active array, and |
| 756 | * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1, |
| 757 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the bottom-right pixel in the |
| 758 | * active pixel array.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 759 | * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight |
Yin-Chia Yeh | 97f1c85 | 2014-05-28 16:36:05 -0700 | [diff] [blame] | 760 | * for every pixel in the area. This means that a large metering area |
| 761 | * with the same weight as a smaller area will have more effect in |
| 762 | * the metering result. Metering areas can partially overlap and the |
| 763 | * camera device will add the weights in the overlap region.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 764 | * <p>The weights are relative to weights of other exposure metering regions, so if only one |
| 765 | * region is used, all non-zero weights will have the same effect. A region with 0 |
| 766 | * weight is ignored.</p> |
| 767 | * <p>If all regions have 0 weight, then no specific metering area needs to be used by the |
| 768 | * camera device.</p> |
| 769 | * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in |
| 770 | * capture result metadata, the camera device will ignore the sections outside the crop |
| 771 | * region and output only the intersection rectangle as the metering region in the result |
| 772 | * metadata. If the region is entirely outside the crop region, it will be ignored and |
| 773 | * not reported in the result metadata.</p> |
Yin-Chia Yeh | 6c73e40 | 2018-06-15 15:37:08 -0700 | [diff] [blame] | 774 | * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} or |
| 775 | * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} depending on |
| 776 | * distortion correction capability and mode</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 777 | * <p><b>Range of valid values:</b><br> |
| 778 | * Coordinates must be between <code>[(0,0), (width, height))</code> of |
Yin-Chia Yeh | 6c73e40 | 2018-06-15 15:37:08 -0700 | [diff] [blame] | 779 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} or {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} |
| 780 | * depending on distortion correction capability and mode</p> |
Yin-Chia Yeh | 808150f | 2014-09-08 15:48:47 -0700 | [diff] [blame] | 781 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 782 | * |
Yin-Chia Yeh | 808150f | 2014-09-08 15:48:47 -0700 | [diff] [blame] | 783 | * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AE |
Yin-Chia Yeh | 6c73e40 | 2018-06-15 15:37:08 -0700 | [diff] [blame] | 784 | * @see CaptureRequest#DISTORTION_CORRECTION_MODE |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 785 | * @see CaptureRequest#SCALER_CROP_REGION |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 786 | * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE |
Yin-Chia Yeh | 6c73e40 | 2018-06-15 15:37:08 -0700 | [diff] [blame] | 787 | * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 788 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 789 | @PublicKey |
Yin-Chia Yeh | 817f893 | 2014-05-19 10:23:27 -0700 | [diff] [blame] | 790 | public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AE_REGIONS = |
| 791 | new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.aeRegions", android.hardware.camera2.params.MeteringRectangle[].class); |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 792 | |
| 793 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 794 | * <p>Range over which the auto-exposure routine can |
| 795 | * adjust the capture frame rate to maintain good |
| 796 | * exposure.</p> |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 797 | * <p>Only constrains auto-exposure (AE) algorithm, not |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 798 | * manual control of {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime} and |
| 799 | * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}.</p> |
| 800 | * <p><b>Units</b>: Frames per second (FPS)</p> |
| 801 | * <p><b>Range of valid values:</b><br> |
| 802 | * Any of the entries in {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES android.control.aeAvailableTargetFpsRanges}</p> |
| 803 | * <p>This key is available on all devices.</p> |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 804 | * |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 805 | * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 806 | * @see CaptureRequest#SENSOR_EXPOSURE_TIME |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 807 | * @see CaptureRequest#SENSOR_FRAME_DURATION |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 808 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 809 | @PublicKey |
Igor Murashkin | 78712a8 | 2014-05-27 18:32:18 -0700 | [diff] [blame] | 810 | public static final Key<android.util.Range<Integer>> CONTROL_AE_TARGET_FPS_RANGE = |
| 811 | new Key<android.util.Range<Integer>>("android.control.aeTargetFpsRange", new TypeReference<android.util.Range<Integer>>() {{ }}); |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 812 | |
| 813 | /** |
| 814 | * <p>Whether the camera device will trigger a precapture |
| 815 | * metering sequence when it processes this request.</p> |
| 816 | * <p>This entry is normally set to IDLE, or is not |
| 817 | * included at all in the request settings. When included and |
Zhijun He | dd72be5 | 2015-02-06 13:49:51 -0800 | [diff] [blame] | 818 | * set to START, the camera device will trigger the auto-exposure (AE) |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 819 | * precapture metering sequence.</p> |
Zhijun He | fa95b04 | 2015-02-09 10:40:49 -0800 | [diff] [blame] | 820 | * <p>When set to CANCEL, the camera device will cancel any active |
| 821 | * precapture metering trigger, and return to its initial AE state. |
| 822 | * If a precapture metering sequence is already completed, and the camera |
| 823 | * device has implicitly locked the AE for subsequent still capture, the |
| 824 | * CANCEL trigger will unlock the AE and return to its initial AE state.</p> |
Zhijun He | dd72be5 | 2015-02-06 13:49:51 -0800 | [diff] [blame] | 825 | * <p>The precapture sequence should be triggered before starting a |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 826 | * high-quality still capture for final metering decisions to |
| 827 | * be made, and for firing pre-capture flash pulses to estimate |
| 828 | * scene brightness and required final capture flash power, when |
| 829 | * the flash is enabled.</p> |
| 830 | * <p>Normally, this entry should be set to START for only a |
| 831 | * single request, and the application should wait until the |
| 832 | * sequence completes before starting a new one.</p> |
Zhijun He | dd72be5 | 2015-02-06 13:49:51 -0800 | [diff] [blame] | 833 | * <p>When a precapture metering sequence is finished, the camera device |
| 834 | * may lock the auto-exposure routine internally to be able to accurately expose the |
| 835 | * subsequent still capture image (<code>{@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} == STILL_CAPTURE</code>). |
| 836 | * For this case, the AE may not resume normal scan if no subsequent still capture is |
| 837 | * submitted. To ensure that the AE routine restarts normal scan, the application should |
| 838 | * submit a request with <code>{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} == true</code>, followed by a request |
| 839 | * with <code>{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} == false</code>, if the application decides not to submit a |
Zhijun He | fa95b04 | 2015-02-09 10:40:49 -0800 | [diff] [blame] | 840 | * still capture request after the precapture sequence completes. Alternatively, for |
| 841 | * API level 23 or newer devices, the CANCEL can be used to unlock the camera device |
| 842 | * internally locked AE if the application doesn't submit a still capture request after |
| 843 | * the AE precapture trigger. Note that, the CANCEL was added in API level 23, and must not |
| 844 | * be used in devices that have earlier API levels.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 845 | * <p>The exact effect of auto-exposure (AE) precapture trigger |
| 846 | * depends on the current AE mode and state; see |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 847 | * {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE precapture state transition |
| 848 | * details.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 849 | * <p>On LEGACY-level devices, the precapture trigger is not supported; |
| 850 | * capturing a high-resolution JPEG image will automatically trigger a |
| 851 | * precapture sequence before the high-resolution capture, including |
| 852 | * potentially firing a pre-capture flash.</p> |
Eino-Ville Talvala | f8a2f57 | 2015-06-24 15:36:38 -0700 | [diff] [blame] | 853 | * <p>Using the precapture trigger and the auto-focus trigger {@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger} |
| 854 | * simultaneously is allowed. However, since these triggers often require cooperation between |
| 855 | * the auto-focus and auto-exposure routines (for example, the may need to be enabled for a |
| 856 | * focus sweep), the camera device may delay acting on a later trigger until the previous |
| 857 | * trigger has been fully handled. This may lead to longer intervals between the trigger and |
| 858 | * changes to {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} indicating the start of the precapture sequence, for |
| 859 | * example.</p> |
| 860 | * <p>If both the precapture and the auto-focus trigger are activated on the same request, then |
| 861 | * the camera device will complete them in the optimal order for that device.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 862 | * <p><b>Possible values:</b> |
| 863 | * <ul> |
| 864 | * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE IDLE}</li> |
| 865 | * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_START START}</li> |
Zhijun He | fa95b04 | 2015-02-09 10:40:49 -0800 | [diff] [blame] | 866 | * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL CANCEL}</li> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 867 | * </ul></p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 868 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 869 | * <p><b>Limited capability</b> - |
| 870 | * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the |
| 871 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 872 | * |
Zhijun He | dd72be5 | 2015-02-06 13:49:51 -0800 | [diff] [blame] | 873 | * @see CaptureRequest#CONTROL_AE_LOCK |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 874 | * @see CaptureResult#CONTROL_AE_STATE |
Eino-Ville Talvala | f8a2f57 | 2015-06-24 15:36:38 -0700 | [diff] [blame] | 875 | * @see CaptureRequest#CONTROL_AF_TRIGGER |
Zhijun He | dd72be5 | 2015-02-06 13:49:51 -0800 | [diff] [blame] | 876 | * @see CaptureRequest#CONTROL_CAPTURE_INTENT |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 877 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 878 | * @see #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE |
| 879 | * @see #CONTROL_AE_PRECAPTURE_TRIGGER_START |
Zhijun He | fa95b04 | 2015-02-09 10:40:49 -0800 | [diff] [blame] | 880 | * @see #CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 881 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 882 | @PublicKey |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 883 | public static final Key<Integer> CONTROL_AE_PRECAPTURE_TRIGGER = |
| 884 | new Key<Integer>("android.control.aePrecaptureTrigger", int.class); |
| 885 | |
| 886 | /** |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 887 | * <p>Current state of the auto-exposure (AE) algorithm.</p> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 888 | * <p>Switching between or enabling AE modes ({@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}) always |
| 889 | * resets the AE state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode}, |
| 890 | * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all |
| 891 | * the algorithm states to INACTIVE.</p> |
| 892 | * <p>The camera device can do several state transitions between two results, if it is |
| 893 | * allowed by the state transition table. For example: INACTIVE may never actually be |
| 894 | * seen in a result.</p> |
| 895 | * <p>The state in the result is the state for this image (in sync with this image): if |
| 896 | * AE state becomes CONVERGED, then the image data associated with this result should |
| 897 | * be good to use.</p> |
| 898 | * <p>Below are state transition tables for different AE modes.</p> |
| 899 | * <table> |
| 900 | * <thead> |
| 901 | * <tr> |
| 902 | * <th align="center">State</th> |
| 903 | * <th align="center">Transition Cause</th> |
| 904 | * <th align="center">New State</th> |
| 905 | * <th align="center">Notes</th> |
| 906 | * </tr> |
| 907 | * </thead> |
| 908 | * <tbody> |
| 909 | * <tr> |
| 910 | * <td align="center">INACTIVE</td> |
| 911 | * <td align="center"></td> |
| 912 | * <td align="center">INACTIVE</td> |
| 913 | * <td align="center">Camera device auto exposure algorithm is disabled</td> |
| 914 | * </tr> |
| 915 | * </tbody> |
| 916 | * </table> |
Chien-Yu Chen | 2cf3357 | 2018-01-11 11:35:41 -0800 | [diff] [blame] | 917 | * <p>When {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is AE_MODE_ON*:</p> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 918 | * <table> |
| 919 | * <thead> |
| 920 | * <tr> |
| 921 | * <th align="center">State</th> |
| 922 | * <th align="center">Transition Cause</th> |
| 923 | * <th align="center">New State</th> |
| 924 | * <th align="center">Notes</th> |
| 925 | * </tr> |
| 926 | * </thead> |
| 927 | * <tbody> |
| 928 | * <tr> |
| 929 | * <td align="center">INACTIVE</td> |
| 930 | * <td align="center">Camera device initiates AE scan</td> |
| 931 | * <td align="center">SEARCHING</td> |
| 932 | * <td align="center">Values changing</td> |
| 933 | * </tr> |
| 934 | * <tr> |
| 935 | * <td align="center">INACTIVE</td> |
| 936 | * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td> |
| 937 | * <td align="center">LOCKED</td> |
| 938 | * <td align="center">Values locked</td> |
| 939 | * </tr> |
| 940 | * <tr> |
| 941 | * <td align="center">SEARCHING</td> |
| 942 | * <td align="center">Camera device finishes AE scan</td> |
| 943 | * <td align="center">CONVERGED</td> |
| 944 | * <td align="center">Good values, not changing</td> |
| 945 | * </tr> |
| 946 | * <tr> |
| 947 | * <td align="center">SEARCHING</td> |
| 948 | * <td align="center">Camera device finishes AE scan</td> |
| 949 | * <td align="center">FLASH_REQUIRED</td> |
| 950 | * <td align="center">Converged but too dark w/o flash</td> |
| 951 | * </tr> |
| 952 | * <tr> |
| 953 | * <td align="center">SEARCHING</td> |
| 954 | * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td> |
| 955 | * <td align="center">LOCKED</td> |
| 956 | * <td align="center">Values locked</td> |
| 957 | * </tr> |
| 958 | * <tr> |
| 959 | * <td align="center">CONVERGED</td> |
| 960 | * <td align="center">Camera device initiates AE scan</td> |
| 961 | * <td align="center">SEARCHING</td> |
| 962 | * <td align="center">Values changing</td> |
| 963 | * </tr> |
| 964 | * <tr> |
| 965 | * <td align="center">CONVERGED</td> |
| 966 | * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td> |
| 967 | * <td align="center">LOCKED</td> |
| 968 | * <td align="center">Values locked</td> |
| 969 | * </tr> |
| 970 | * <tr> |
| 971 | * <td align="center">FLASH_REQUIRED</td> |
| 972 | * <td align="center">Camera device initiates AE scan</td> |
| 973 | * <td align="center">SEARCHING</td> |
| 974 | * <td align="center">Values changing</td> |
| 975 | * </tr> |
| 976 | * <tr> |
| 977 | * <td align="center">FLASH_REQUIRED</td> |
| 978 | * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td> |
| 979 | * <td align="center">LOCKED</td> |
| 980 | * <td align="center">Values locked</td> |
| 981 | * </tr> |
| 982 | * <tr> |
| 983 | * <td align="center">LOCKED</td> |
| 984 | * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td> |
| 985 | * <td align="center">SEARCHING</td> |
| 986 | * <td align="center">Values not good after unlock</td> |
| 987 | * </tr> |
| 988 | * <tr> |
| 989 | * <td align="center">LOCKED</td> |
| 990 | * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td> |
| 991 | * <td align="center">CONVERGED</td> |
| 992 | * <td align="center">Values good after unlock</td> |
| 993 | * </tr> |
| 994 | * <tr> |
| 995 | * <td align="center">LOCKED</td> |
| 996 | * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td> |
| 997 | * <td align="center">FLASH_REQUIRED</td> |
| 998 | * <td align="center">Exposure good, but too dark</td> |
| 999 | * </tr> |
| 1000 | * <tr> |
| 1001 | * <td align="center">PRECAPTURE</td> |
| 1002 | * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td> |
| 1003 | * <td align="center">CONVERGED</td> |
| 1004 | * <td align="center">Ready for high-quality capture</td> |
| 1005 | * </tr> |
| 1006 | * <tr> |
| 1007 | * <td align="center">PRECAPTURE</td> |
| 1008 | * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td> |
| 1009 | * <td align="center">LOCKED</td> |
| 1010 | * <td align="center">Ready for high-quality capture</td> |
| 1011 | * </tr> |
| 1012 | * <tr> |
Zhijun He | fa95b04 | 2015-02-09 10:40:49 -0800 | [diff] [blame] | 1013 | * <td align="center">LOCKED</td> |
| 1014 | * <td align="center">aeLock is ON and aePrecaptureTrigger is START</td> |
| 1015 | * <td align="center">LOCKED</td> |
| 1016 | * <td align="center">Precapture trigger is ignored when AE is already locked</td> |
| 1017 | * </tr> |
| 1018 | * <tr> |
| 1019 | * <td align="center">LOCKED</td> |
| 1020 | * <td align="center">aeLock is ON and aePrecaptureTrigger is CANCEL</td> |
| 1021 | * <td align="center">LOCKED</td> |
| 1022 | * <td align="center">Precapture trigger is ignored when AE is already locked</td> |
| 1023 | * </tr> |
| 1024 | * <tr> |
| 1025 | * <td align="center">Any state (excluding LOCKED)</td> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 1026 | * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START</td> |
| 1027 | * <td align="center">PRECAPTURE</td> |
| 1028 | * <td align="center">Start AE precapture metering sequence</td> |
| 1029 | * </tr> |
Zhijun He | fa95b04 | 2015-02-09 10:40:49 -0800 | [diff] [blame] | 1030 | * <tr> |
| 1031 | * <td align="center">Any state (excluding LOCKED)</td> |
| 1032 | * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is CANCEL</td> |
| 1033 | * <td align="center">INACTIVE</td> |
| 1034 | * <td align="center">Currently active precapture metering sequence is canceled</td> |
| 1035 | * </tr> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 1036 | * </tbody> |
| 1037 | * </table> |
Chien-Yu Chen | 2cf3357 | 2018-01-11 11:35:41 -0800 | [diff] [blame] | 1038 | * <p>If the camera device supports AE external flash mode (ON_EXTERNAL_FLASH is included in |
Chien-Yu Chen | c9ca722 | 2018-03-15 11:14:29 -0700 | [diff] [blame] | 1039 | * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES android.control.aeAvailableModes}), {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} must be FLASH_REQUIRED after |
| 1040 | * the camera device finishes AE scan and it's too dark without flash.</p> |
Zhijun He | 60b19dc | 2014-02-24 10:19:20 -0800 | [diff] [blame] | 1041 | * <p>For the above table, the camera device may skip reporting any state changes that happen |
| 1042 | * without application intervention (i.e. mode switch, trigger, locking). Any state that |
| 1043 | * can be skipped in that manner is called a transient state.</p> |
Chien-Yu Chen | 2cf3357 | 2018-01-11 11:35:41 -0800 | [diff] [blame] | 1044 | * <p>For example, for above AE modes (AE_MODE_ON*), in addition to the state transitions |
Zhijun He | 60b19dc | 2014-02-24 10:19:20 -0800 | [diff] [blame] | 1045 | * listed in above table, it is also legal for the camera device to skip one or more |
| 1046 | * transient states between two results. See below table for examples:</p> |
| 1047 | * <table> |
| 1048 | * <thead> |
| 1049 | * <tr> |
| 1050 | * <th align="center">State</th> |
| 1051 | * <th align="center">Transition Cause</th> |
| 1052 | * <th align="center">New State</th> |
| 1053 | * <th align="center">Notes</th> |
| 1054 | * </tr> |
| 1055 | * </thead> |
| 1056 | * <tbody> |
| 1057 | * <tr> |
| 1058 | * <td align="center">INACTIVE</td> |
| 1059 | * <td align="center">Camera device finished AE scan</td> |
| 1060 | * <td align="center">CONVERGED</td> |
| 1061 | * <td align="center">Values are already good, transient states are skipped by camera device.</td> |
| 1062 | * </tr> |
| 1063 | * <tr> |
Zhijun He | fa95b04 | 2015-02-09 10:40:49 -0800 | [diff] [blame] | 1064 | * <td align="center">Any state (excluding LOCKED)</td> |
Zhijun He | 60b19dc | 2014-02-24 10:19:20 -0800 | [diff] [blame] | 1065 | * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td> |
| 1066 | * <td align="center">FLASH_REQUIRED</td> |
| 1067 | * <td align="center">Converged but too dark w/o flash after a precapture sequence, transient states are skipped by camera device.</td> |
| 1068 | * </tr> |
| 1069 | * <tr> |
Zhijun He | fa95b04 | 2015-02-09 10:40:49 -0800 | [diff] [blame] | 1070 | * <td align="center">Any state (excluding LOCKED)</td> |
Zhijun He | 60b19dc | 2014-02-24 10:19:20 -0800 | [diff] [blame] | 1071 | * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td> |
| 1072 | * <td align="center">CONVERGED</td> |
| 1073 | * <td align="center">Converged after a precapture sequence, transient states are skipped by camera device.</td> |
| 1074 | * </tr> |
| 1075 | * <tr> |
Zhijun He | fa95b04 | 2015-02-09 10:40:49 -0800 | [diff] [blame] | 1076 | * <td align="center">Any state (excluding LOCKED)</td> |
| 1077 | * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is CANCEL, converged</td> |
| 1078 | * <td align="center">FLASH_REQUIRED</td> |
| 1079 | * <td align="center">Converged but too dark w/o flash after a precapture sequence is canceled, transient states are skipped by camera device.</td> |
| 1080 | * </tr> |
| 1081 | * <tr> |
| 1082 | * <td align="center">Any state (excluding LOCKED)</td> |
| 1083 | * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is CANCEL, converged</td> |
| 1084 | * <td align="center">CONVERGED</td> |
| 1085 | * <td align="center">Converged after a precapture sequenceis canceled, transient states are skipped by camera device.</td> |
| 1086 | * </tr> |
| 1087 | * <tr> |
Zhijun He | 60b19dc | 2014-02-24 10:19:20 -0800 | [diff] [blame] | 1088 | * <td align="center">CONVERGED</td> |
| 1089 | * <td align="center">Camera device finished AE scan</td> |
| 1090 | * <td align="center">FLASH_REQUIRED</td> |
| 1091 | * <td align="center">Converged but too dark w/o flash after a new scan, transient states are skipped by camera device.</td> |
| 1092 | * </tr> |
| 1093 | * <tr> |
| 1094 | * <td align="center">FLASH_REQUIRED</td> |
| 1095 | * <td align="center">Camera device finished AE scan</td> |
| 1096 | * <td align="center">CONVERGED</td> |
| 1097 | * <td align="center">Converged after a new scan, transient states are skipped by camera device.</td> |
| 1098 | * </tr> |
| 1099 | * </tbody> |
| 1100 | * </table> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1101 | * <p><b>Possible values:</b> |
| 1102 | * <ul> |
| 1103 | * <li>{@link #CONTROL_AE_STATE_INACTIVE INACTIVE}</li> |
| 1104 | * <li>{@link #CONTROL_AE_STATE_SEARCHING SEARCHING}</li> |
| 1105 | * <li>{@link #CONTROL_AE_STATE_CONVERGED CONVERGED}</li> |
| 1106 | * <li>{@link #CONTROL_AE_STATE_LOCKED LOCKED}</li> |
| 1107 | * <li>{@link #CONTROL_AE_STATE_FLASH_REQUIRED FLASH_REQUIRED}</li> |
| 1108 | * <li>{@link #CONTROL_AE_STATE_PRECAPTURE PRECAPTURE}</li> |
| 1109 | * </ul></p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1110 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 1111 | * <p><b>Limited capability</b> - |
| 1112 | * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the |
| 1113 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 1114 | * |
Chien-Yu Chen | 2cf3357 | 2018-01-11 11:35:41 -0800 | [diff] [blame] | 1115 | * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 1116 | * @see CaptureRequest#CONTROL_AE_LOCK |
| 1117 | * @see CaptureRequest#CONTROL_AE_MODE |
| 1118 | * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER |
Chien-Yu Chen | c9ca722 | 2018-03-15 11:14:29 -0700 | [diff] [blame] | 1119 | * @see CaptureResult#CONTROL_AE_STATE |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 1120 | * @see CaptureRequest#CONTROL_MODE |
| 1121 | * @see CaptureRequest#CONTROL_SCENE_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1122 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1123 | * @see #CONTROL_AE_STATE_INACTIVE |
| 1124 | * @see #CONTROL_AE_STATE_SEARCHING |
| 1125 | * @see #CONTROL_AE_STATE_CONVERGED |
| 1126 | * @see #CONTROL_AE_STATE_LOCKED |
| 1127 | * @see #CONTROL_AE_STATE_FLASH_REQUIRED |
| 1128 | * @see #CONTROL_AE_STATE_PRECAPTURE |
| 1129 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1130 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1131 | public static final Key<Integer> CONTROL_AE_STATE = |
| 1132 | new Key<Integer>("android.control.aeState", int.class); |
| 1133 | |
| 1134 | /** |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 1135 | * <p>Whether auto-focus (AF) is currently enabled, and what |
| 1136 | * mode it is set to.</p> |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 1137 | * <p>Only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} = AUTO and the lens is not fixed focus |
Yin-Chia Yeh | 7144b5d | 2014-11-12 11:42:49 -0800 | [diff] [blame] | 1138 | * (i.e. <code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} > 0</code>). Also note that |
| 1139 | * when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF, the behavior of AF is device |
| 1140 | * dependent. It is recommended to lock AF by using {@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger} before |
| 1141 | * setting {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} to OFF, or set AF mode to OFF when AE is OFF.</p> |
Zhijun He | 78146ec | 2014-01-14 18:12:13 -0800 | [diff] [blame] | 1142 | * <p>If the lens is controlled by the camera device auto-focus algorithm, |
Eino-Ville Talvala | d8fd679 | 2014-02-10 12:41:04 -0800 | [diff] [blame] | 1143 | * the camera device will report the current AF status in {@link CaptureResult#CONTROL_AF_STATE android.control.afState} |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1144 | * in result metadata.</p> |
| 1145 | * <p><b>Possible values:</b> |
| 1146 | * <ul> |
| 1147 | * <li>{@link #CONTROL_AF_MODE_OFF OFF}</li> |
| 1148 | * <li>{@link #CONTROL_AF_MODE_AUTO AUTO}</li> |
| 1149 | * <li>{@link #CONTROL_AF_MODE_MACRO MACRO}</li> |
| 1150 | * <li>{@link #CONTROL_AF_MODE_CONTINUOUS_VIDEO CONTINUOUS_VIDEO}</li> |
| 1151 | * <li>{@link #CONTROL_AF_MODE_CONTINUOUS_PICTURE CONTINUOUS_PICTURE}</li> |
| 1152 | * <li>{@link #CONTROL_AF_MODE_EDOF EDOF}</li> |
| 1153 | * </ul></p> |
| 1154 | * <p><b>Available values for this device:</b><br> |
| 1155 | * {@link CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES android.control.afAvailableModes}</p> |
| 1156 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1157 | * |
Yin-Chia Yeh | 7144b5d | 2014-11-12 11:42:49 -0800 | [diff] [blame] | 1158 | * @see CaptureRequest#CONTROL_AE_MODE |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1159 | * @see CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES |
Eino-Ville Talvala | d8fd679 | 2014-02-10 12:41:04 -0800 | [diff] [blame] | 1160 | * @see CaptureResult#CONTROL_AF_STATE |
Yin-Chia Yeh | 7144b5d | 2014-11-12 11:42:49 -0800 | [diff] [blame] | 1161 | * @see CaptureRequest#CONTROL_AF_TRIGGER |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1162 | * @see CaptureRequest#CONTROL_MODE |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 1163 | * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1164 | * @see #CONTROL_AF_MODE_OFF |
| 1165 | * @see #CONTROL_AF_MODE_AUTO |
| 1166 | * @see #CONTROL_AF_MODE_MACRO |
| 1167 | * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO |
| 1168 | * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE |
| 1169 | * @see #CONTROL_AF_MODE_EDOF |
| 1170 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1171 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1172 | public static final Key<Integer> CONTROL_AF_MODE = |
| 1173 | new Key<Integer>("android.control.afMode", int.class); |
| 1174 | |
| 1175 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1176 | * <p>List of metering areas to use for auto-focus.</p> |
| 1177 | * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf} is 0. |
Yin-Chia Yeh | 808150f | 2014-09-08 15:48:47 -0700 | [diff] [blame] | 1178 | * Otherwise will always be present.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1179 | * <p>The maximum number of focus areas supported by the device is determined by the value |
| 1180 | * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf}.</p> |
Yin-Chia Yeh | 6c73e40 | 2018-06-15 15:37:08 -0700 | [diff] [blame] | 1181 | * <p>For devices not supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate |
| 1182 | * system always follows that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with (0,0) being |
| 1183 | * the top-left pixel in the active pixel array, and |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1184 | * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1, |
Yin-Chia Yeh | 6c73e40 | 2018-06-15 15:37:08 -0700 | [diff] [blame] | 1185 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the bottom-right pixel in the |
| 1186 | * active pixel array.</p> |
| 1187 | * <p>For devices supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate |
| 1188 | * system depends on the mode being set. |
| 1189 | * When the distortion correction mode is OFF, the coordinate system follows |
| 1190 | * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, with |
| 1191 | * <code>(0, 0)</code> being the top-left pixel of the pre-correction active array, and |
| 1192 | * ({@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.width - 1, |
| 1193 | * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.height - 1) being the bottom-right |
| 1194 | * pixel in the pre-correction active pixel array. |
| 1195 | * When the distortion correction mode is not OFF, the coordinate system follows |
| 1196 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with |
| 1197 | * <code>(0, 0)</code> being the top-left pixel of the active array, and |
| 1198 | * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1, |
| 1199 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the bottom-right pixel in the |
| 1200 | * active pixel array.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1201 | * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight |
Yin-Chia Yeh | 97f1c85 | 2014-05-28 16:36:05 -0700 | [diff] [blame] | 1202 | * for every pixel in the area. This means that a large metering area |
| 1203 | * with the same weight as a smaller area will have more effect in |
| 1204 | * the metering result. Metering areas can partially overlap and the |
| 1205 | * camera device will add the weights in the overlap region.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1206 | * <p>The weights are relative to weights of other metering regions, so if only one region |
| 1207 | * is used, all non-zero weights will have the same effect. A region with 0 weight is |
| 1208 | * ignored.</p> |
| 1209 | * <p>If all regions have 0 weight, then no specific metering area needs to be used by the |
Shuzhen Wang | a31d58f | 2018-02-08 12:44:47 -0800 | [diff] [blame] | 1210 | * camera device. The capture result will either be a zero weight region as well, or |
| 1211 | * the region selected by the camera device as the focus area of interest.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1212 | * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in |
| 1213 | * capture result metadata, the camera device will ignore the sections outside the crop |
| 1214 | * region and output only the intersection rectangle as the metering region in the result |
| 1215 | * metadata. If the region is entirely outside the crop region, it will be ignored and |
| 1216 | * not reported in the result metadata.</p> |
Yin-Chia Yeh | 6c73e40 | 2018-06-15 15:37:08 -0700 | [diff] [blame] | 1217 | * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} or |
| 1218 | * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} depending on |
| 1219 | * distortion correction capability and mode</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1220 | * <p><b>Range of valid values:</b><br> |
| 1221 | * Coordinates must be between <code>[(0,0), (width, height))</code> of |
Yin-Chia Yeh | 6c73e40 | 2018-06-15 15:37:08 -0700 | [diff] [blame] | 1222 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} or {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} |
| 1223 | * depending on distortion correction capability and mode</p> |
Yin-Chia Yeh | 808150f | 2014-09-08 15:48:47 -0700 | [diff] [blame] | 1224 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1225 | * |
Yin-Chia Yeh | 808150f | 2014-09-08 15:48:47 -0700 | [diff] [blame] | 1226 | * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AF |
Yin-Chia Yeh | 6c73e40 | 2018-06-15 15:37:08 -0700 | [diff] [blame] | 1227 | * @see CaptureRequest#DISTORTION_CORRECTION_MODE |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1228 | * @see CaptureRequest#SCALER_CROP_REGION |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 1229 | * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE |
Yin-Chia Yeh | 6c73e40 | 2018-06-15 15:37:08 -0700 | [diff] [blame] | 1230 | * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1231 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1232 | @PublicKey |
Yin-Chia Yeh | 817f893 | 2014-05-19 10:23:27 -0700 | [diff] [blame] | 1233 | public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AF_REGIONS = |
| 1234 | new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.afRegions", android.hardware.camera2.params.MeteringRectangle[].class); |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1235 | |
| 1236 | /** |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 1237 | * <p>Whether the camera device will trigger autofocus for this request.</p> |
| 1238 | * <p>This entry is normally set to IDLE, or is not |
| 1239 | * included at all in the request settings.</p> |
| 1240 | * <p>When included and set to START, the camera device will trigger the |
| 1241 | * autofocus algorithm. If autofocus is disabled, this trigger has no effect.</p> |
| 1242 | * <p>When set to CANCEL, the camera device will cancel any active trigger, |
| 1243 | * and return to its initial AF state.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1244 | * <p>Generally, applications should set this entry to START or CANCEL for only a |
| 1245 | * single capture, and then return it to IDLE (or not set at all). Specifying |
| 1246 | * START for multiple captures in a row means restarting the AF operation over |
| 1247 | * and over again.</p> |
| 1248 | * <p>See {@link CaptureResult#CONTROL_AF_STATE android.control.afState} for what the trigger means for each AF mode.</p> |
Eino-Ville Talvala | f8a2f57 | 2015-06-24 15:36:38 -0700 | [diff] [blame] | 1249 | * <p>Using the autofocus trigger and the precapture trigger {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} |
| 1250 | * simultaneously is allowed. However, since these triggers often require cooperation between |
| 1251 | * the auto-focus and auto-exposure routines (for example, the may need to be enabled for a |
| 1252 | * focus sweep), the camera device may delay acting on a later trigger until the previous |
| 1253 | * trigger has been fully handled. This may lead to longer intervals between the trigger and |
| 1254 | * changes to {@link CaptureResult#CONTROL_AF_STATE android.control.afState}, for example.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1255 | * <p><b>Possible values:</b> |
| 1256 | * <ul> |
| 1257 | * <li>{@link #CONTROL_AF_TRIGGER_IDLE IDLE}</li> |
| 1258 | * <li>{@link #CONTROL_AF_TRIGGER_START START}</li> |
| 1259 | * <li>{@link #CONTROL_AF_TRIGGER_CANCEL CANCEL}</li> |
| 1260 | * </ul></p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1261 | * <p>This key is available on all devices.</p> |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 1262 | * |
Eino-Ville Talvala | f8a2f57 | 2015-06-24 15:36:38 -0700 | [diff] [blame] | 1263 | * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 1264 | * @see CaptureResult#CONTROL_AF_STATE |
| 1265 | * @see #CONTROL_AF_TRIGGER_IDLE |
| 1266 | * @see #CONTROL_AF_TRIGGER_START |
| 1267 | * @see #CONTROL_AF_TRIGGER_CANCEL |
| 1268 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1269 | @PublicKey |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 1270 | public static final Key<Integer> CONTROL_AF_TRIGGER = |
| 1271 | new Key<Integer>("android.control.afTrigger", int.class); |
| 1272 | |
| 1273 | /** |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 1274 | * <p>Current state of auto-focus (AF) algorithm.</p> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 1275 | * <p>Switching between or enabling AF modes ({@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}) always |
| 1276 | * resets the AF state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode}, |
| 1277 | * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all |
| 1278 | * the algorithm states to INACTIVE.</p> |
| 1279 | * <p>The camera device can do several state transitions between two results, if it is |
| 1280 | * allowed by the state transition table. For example: INACTIVE may never actually be |
| 1281 | * seen in a result.</p> |
| 1282 | * <p>The state in the result is the state for this image (in sync with this image): if |
| 1283 | * AF state becomes FOCUSED, then the image data associated with this result should |
| 1284 | * be sharp.</p> |
| 1285 | * <p>Below are state transition tables for different AF modes.</p> |
| 1286 | * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_OFF or AF_MODE_EDOF:</p> |
| 1287 | * <table> |
| 1288 | * <thead> |
| 1289 | * <tr> |
| 1290 | * <th align="center">State</th> |
| 1291 | * <th align="center">Transition Cause</th> |
| 1292 | * <th align="center">New State</th> |
| 1293 | * <th align="center">Notes</th> |
| 1294 | * </tr> |
| 1295 | * </thead> |
| 1296 | * <tbody> |
| 1297 | * <tr> |
| 1298 | * <td align="center">INACTIVE</td> |
| 1299 | * <td align="center"></td> |
| 1300 | * <td align="center">INACTIVE</td> |
| 1301 | * <td align="center">Never changes</td> |
| 1302 | * </tr> |
| 1303 | * </tbody> |
| 1304 | * </table> |
| 1305 | * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_AUTO or AF_MODE_MACRO:</p> |
| 1306 | * <table> |
| 1307 | * <thead> |
| 1308 | * <tr> |
| 1309 | * <th align="center">State</th> |
| 1310 | * <th align="center">Transition Cause</th> |
| 1311 | * <th align="center">New State</th> |
| 1312 | * <th align="center">Notes</th> |
| 1313 | * </tr> |
| 1314 | * </thead> |
| 1315 | * <tbody> |
| 1316 | * <tr> |
| 1317 | * <td align="center">INACTIVE</td> |
| 1318 | * <td align="center">AF_TRIGGER</td> |
| 1319 | * <td align="center">ACTIVE_SCAN</td> |
| 1320 | * <td align="center">Start AF sweep, Lens now moving</td> |
| 1321 | * </tr> |
| 1322 | * <tr> |
| 1323 | * <td align="center">ACTIVE_SCAN</td> |
| 1324 | * <td align="center">AF sweep done</td> |
| 1325 | * <td align="center">FOCUSED_LOCKED</td> |
| 1326 | * <td align="center">Focused, Lens now locked</td> |
| 1327 | * </tr> |
| 1328 | * <tr> |
| 1329 | * <td align="center">ACTIVE_SCAN</td> |
| 1330 | * <td align="center">AF sweep done</td> |
| 1331 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 1332 | * <td align="center">Not focused, Lens now locked</td> |
| 1333 | * </tr> |
| 1334 | * <tr> |
| 1335 | * <td align="center">ACTIVE_SCAN</td> |
| 1336 | * <td align="center">AF_CANCEL</td> |
| 1337 | * <td align="center">INACTIVE</td> |
| 1338 | * <td align="center">Cancel/reset AF, Lens now locked</td> |
| 1339 | * </tr> |
| 1340 | * <tr> |
| 1341 | * <td align="center">FOCUSED_LOCKED</td> |
| 1342 | * <td align="center">AF_CANCEL</td> |
| 1343 | * <td align="center">INACTIVE</td> |
| 1344 | * <td align="center">Cancel/reset AF</td> |
| 1345 | * </tr> |
| 1346 | * <tr> |
| 1347 | * <td align="center">FOCUSED_LOCKED</td> |
| 1348 | * <td align="center">AF_TRIGGER</td> |
| 1349 | * <td align="center">ACTIVE_SCAN</td> |
| 1350 | * <td align="center">Start new sweep, Lens now moving</td> |
| 1351 | * </tr> |
| 1352 | * <tr> |
| 1353 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 1354 | * <td align="center">AF_CANCEL</td> |
| 1355 | * <td align="center">INACTIVE</td> |
| 1356 | * <td align="center">Cancel/reset AF</td> |
| 1357 | * </tr> |
| 1358 | * <tr> |
| 1359 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 1360 | * <td align="center">AF_TRIGGER</td> |
| 1361 | * <td align="center">ACTIVE_SCAN</td> |
| 1362 | * <td align="center">Start new sweep, Lens now moving</td> |
| 1363 | * </tr> |
| 1364 | * <tr> |
| 1365 | * <td align="center">Any state</td> |
| 1366 | * <td align="center">Mode change</td> |
| 1367 | * <td align="center">INACTIVE</td> |
| 1368 | * <td align="center"></td> |
| 1369 | * </tr> |
| 1370 | * </tbody> |
| 1371 | * </table> |
Zhijun He | 60b19dc | 2014-02-24 10:19:20 -0800 | [diff] [blame] | 1372 | * <p>For the above table, the camera device may skip reporting any state changes that happen |
| 1373 | * without application intervention (i.e. mode switch, trigger, locking). Any state that |
| 1374 | * can be skipped in that manner is called a transient state.</p> |
| 1375 | * <p>For example, for these AF modes (AF_MODE_AUTO and AF_MODE_MACRO), in addition to the |
| 1376 | * state transitions listed in above table, it is also legal for the camera device to skip |
| 1377 | * one or more transient states between two results. See below table for examples:</p> |
| 1378 | * <table> |
| 1379 | * <thead> |
| 1380 | * <tr> |
| 1381 | * <th align="center">State</th> |
| 1382 | * <th align="center">Transition Cause</th> |
| 1383 | * <th align="center">New State</th> |
| 1384 | * <th align="center">Notes</th> |
| 1385 | * </tr> |
| 1386 | * </thead> |
| 1387 | * <tbody> |
| 1388 | * <tr> |
| 1389 | * <td align="center">INACTIVE</td> |
| 1390 | * <td align="center">AF_TRIGGER</td> |
| 1391 | * <td align="center">FOCUSED_LOCKED</td> |
| 1392 | * <td align="center">Focus is already good or good after a scan, lens is now locked.</td> |
| 1393 | * </tr> |
| 1394 | * <tr> |
| 1395 | * <td align="center">INACTIVE</td> |
| 1396 | * <td align="center">AF_TRIGGER</td> |
| 1397 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 1398 | * <td align="center">Focus failed after a scan, lens is now locked.</td> |
| 1399 | * </tr> |
| 1400 | * <tr> |
| 1401 | * <td align="center">FOCUSED_LOCKED</td> |
| 1402 | * <td align="center">AF_TRIGGER</td> |
| 1403 | * <td align="center">FOCUSED_LOCKED</td> |
| 1404 | * <td align="center">Focus is already good or good after a scan, lens is now locked.</td> |
| 1405 | * </tr> |
| 1406 | * <tr> |
| 1407 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 1408 | * <td align="center">AF_TRIGGER</td> |
| 1409 | * <td align="center">FOCUSED_LOCKED</td> |
| 1410 | * <td align="center">Focus is good after a scan, lens is not locked.</td> |
| 1411 | * </tr> |
| 1412 | * </tbody> |
| 1413 | * </table> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 1414 | * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_VIDEO:</p> |
| 1415 | * <table> |
| 1416 | * <thead> |
| 1417 | * <tr> |
| 1418 | * <th align="center">State</th> |
| 1419 | * <th align="center">Transition Cause</th> |
| 1420 | * <th align="center">New State</th> |
| 1421 | * <th align="center">Notes</th> |
| 1422 | * </tr> |
| 1423 | * </thead> |
| 1424 | * <tbody> |
| 1425 | * <tr> |
| 1426 | * <td align="center">INACTIVE</td> |
| 1427 | * <td align="center">Camera device initiates new scan</td> |
| 1428 | * <td align="center">PASSIVE_SCAN</td> |
| 1429 | * <td align="center">Start AF scan, Lens now moving</td> |
| 1430 | * </tr> |
| 1431 | * <tr> |
| 1432 | * <td align="center">INACTIVE</td> |
| 1433 | * <td align="center">AF_TRIGGER</td> |
| 1434 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 1435 | * <td align="center">AF state query, Lens now locked</td> |
| 1436 | * </tr> |
| 1437 | * <tr> |
| 1438 | * <td align="center">PASSIVE_SCAN</td> |
| 1439 | * <td align="center">Camera device completes current scan</td> |
| 1440 | * <td align="center">PASSIVE_FOCUSED</td> |
| 1441 | * <td align="center">End AF scan, Lens now locked</td> |
| 1442 | * </tr> |
| 1443 | * <tr> |
| 1444 | * <td align="center">PASSIVE_SCAN</td> |
| 1445 | * <td align="center">Camera device fails current scan</td> |
| 1446 | * <td align="center">PASSIVE_UNFOCUSED</td> |
| 1447 | * <td align="center">End AF scan, Lens now locked</td> |
| 1448 | * </tr> |
| 1449 | * <tr> |
| 1450 | * <td align="center">PASSIVE_SCAN</td> |
| 1451 | * <td align="center">AF_TRIGGER</td> |
| 1452 | * <td align="center">FOCUSED_LOCKED</td> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1453 | * <td align="center">Immediate transition, if focus is good. Lens now locked</td> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 1454 | * </tr> |
| 1455 | * <tr> |
| 1456 | * <td align="center">PASSIVE_SCAN</td> |
| 1457 | * <td align="center">AF_TRIGGER</td> |
| 1458 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1459 | * <td align="center">Immediate transition, if focus is bad. Lens now locked</td> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 1460 | * </tr> |
| 1461 | * <tr> |
| 1462 | * <td align="center">PASSIVE_SCAN</td> |
| 1463 | * <td align="center">AF_CANCEL</td> |
| 1464 | * <td align="center">INACTIVE</td> |
| 1465 | * <td align="center">Reset lens position, Lens now locked</td> |
| 1466 | * </tr> |
| 1467 | * <tr> |
| 1468 | * <td align="center">PASSIVE_FOCUSED</td> |
| 1469 | * <td align="center">Camera device initiates new scan</td> |
| 1470 | * <td align="center">PASSIVE_SCAN</td> |
| 1471 | * <td align="center">Start AF scan, Lens now moving</td> |
| 1472 | * </tr> |
| 1473 | * <tr> |
| 1474 | * <td align="center">PASSIVE_UNFOCUSED</td> |
| 1475 | * <td align="center">Camera device initiates new scan</td> |
| 1476 | * <td align="center">PASSIVE_SCAN</td> |
| 1477 | * <td align="center">Start AF scan, Lens now moving</td> |
| 1478 | * </tr> |
| 1479 | * <tr> |
| 1480 | * <td align="center">PASSIVE_FOCUSED</td> |
| 1481 | * <td align="center">AF_TRIGGER</td> |
| 1482 | * <td align="center">FOCUSED_LOCKED</td> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1483 | * <td align="center">Immediate transition, lens now locked</td> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 1484 | * </tr> |
| 1485 | * <tr> |
| 1486 | * <td align="center">PASSIVE_UNFOCUSED</td> |
| 1487 | * <td align="center">AF_TRIGGER</td> |
| 1488 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1489 | * <td align="center">Immediate transition, lens now locked</td> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 1490 | * </tr> |
| 1491 | * <tr> |
| 1492 | * <td align="center">FOCUSED_LOCKED</td> |
| 1493 | * <td align="center">AF_TRIGGER</td> |
| 1494 | * <td align="center">FOCUSED_LOCKED</td> |
| 1495 | * <td align="center">No effect</td> |
| 1496 | * </tr> |
| 1497 | * <tr> |
| 1498 | * <td align="center">FOCUSED_LOCKED</td> |
| 1499 | * <td align="center">AF_CANCEL</td> |
| 1500 | * <td align="center">INACTIVE</td> |
| 1501 | * <td align="center">Restart AF scan</td> |
| 1502 | * </tr> |
| 1503 | * <tr> |
| 1504 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 1505 | * <td align="center">AF_TRIGGER</td> |
| 1506 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 1507 | * <td align="center">No effect</td> |
| 1508 | * </tr> |
| 1509 | * <tr> |
| 1510 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 1511 | * <td align="center">AF_CANCEL</td> |
| 1512 | * <td align="center">INACTIVE</td> |
| 1513 | * <td align="center">Restart AF scan</td> |
| 1514 | * </tr> |
| 1515 | * </tbody> |
| 1516 | * </table> |
| 1517 | * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_PICTURE:</p> |
| 1518 | * <table> |
| 1519 | * <thead> |
| 1520 | * <tr> |
| 1521 | * <th align="center">State</th> |
| 1522 | * <th align="center">Transition Cause</th> |
| 1523 | * <th align="center">New State</th> |
| 1524 | * <th align="center">Notes</th> |
| 1525 | * </tr> |
| 1526 | * </thead> |
| 1527 | * <tbody> |
| 1528 | * <tr> |
| 1529 | * <td align="center">INACTIVE</td> |
| 1530 | * <td align="center">Camera device initiates new scan</td> |
| 1531 | * <td align="center">PASSIVE_SCAN</td> |
| 1532 | * <td align="center">Start AF scan, Lens now moving</td> |
| 1533 | * </tr> |
| 1534 | * <tr> |
| 1535 | * <td align="center">INACTIVE</td> |
| 1536 | * <td align="center">AF_TRIGGER</td> |
| 1537 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 1538 | * <td align="center">AF state query, Lens now locked</td> |
| 1539 | * </tr> |
| 1540 | * <tr> |
| 1541 | * <td align="center">PASSIVE_SCAN</td> |
| 1542 | * <td align="center">Camera device completes current scan</td> |
| 1543 | * <td align="center">PASSIVE_FOCUSED</td> |
| 1544 | * <td align="center">End AF scan, Lens now locked</td> |
| 1545 | * </tr> |
| 1546 | * <tr> |
| 1547 | * <td align="center">PASSIVE_SCAN</td> |
| 1548 | * <td align="center">Camera device fails current scan</td> |
| 1549 | * <td align="center">PASSIVE_UNFOCUSED</td> |
| 1550 | * <td align="center">End AF scan, Lens now locked</td> |
| 1551 | * </tr> |
| 1552 | * <tr> |
| 1553 | * <td align="center">PASSIVE_SCAN</td> |
| 1554 | * <td align="center">AF_TRIGGER</td> |
| 1555 | * <td align="center">FOCUSED_LOCKED</td> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1556 | * <td align="center">Eventual transition once the focus is good. Lens now locked</td> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 1557 | * </tr> |
| 1558 | * <tr> |
| 1559 | * <td align="center">PASSIVE_SCAN</td> |
| 1560 | * <td align="center">AF_TRIGGER</td> |
| 1561 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1562 | * <td align="center">Eventual transition if cannot find focus. Lens now locked</td> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 1563 | * </tr> |
| 1564 | * <tr> |
| 1565 | * <td align="center">PASSIVE_SCAN</td> |
| 1566 | * <td align="center">AF_CANCEL</td> |
| 1567 | * <td align="center">INACTIVE</td> |
| 1568 | * <td align="center">Reset lens position, Lens now locked</td> |
| 1569 | * </tr> |
| 1570 | * <tr> |
| 1571 | * <td align="center">PASSIVE_FOCUSED</td> |
| 1572 | * <td align="center">Camera device initiates new scan</td> |
| 1573 | * <td align="center">PASSIVE_SCAN</td> |
| 1574 | * <td align="center">Start AF scan, Lens now moving</td> |
| 1575 | * </tr> |
| 1576 | * <tr> |
| 1577 | * <td align="center">PASSIVE_UNFOCUSED</td> |
| 1578 | * <td align="center">Camera device initiates new scan</td> |
| 1579 | * <td align="center">PASSIVE_SCAN</td> |
| 1580 | * <td align="center">Start AF scan, Lens now moving</td> |
| 1581 | * </tr> |
| 1582 | * <tr> |
| 1583 | * <td align="center">PASSIVE_FOCUSED</td> |
| 1584 | * <td align="center">AF_TRIGGER</td> |
| 1585 | * <td align="center">FOCUSED_LOCKED</td> |
| 1586 | * <td align="center">Immediate trans. Lens now locked</td> |
| 1587 | * </tr> |
| 1588 | * <tr> |
| 1589 | * <td align="center">PASSIVE_UNFOCUSED</td> |
| 1590 | * <td align="center">AF_TRIGGER</td> |
| 1591 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 1592 | * <td align="center">Immediate trans. Lens now locked</td> |
| 1593 | * </tr> |
| 1594 | * <tr> |
| 1595 | * <td align="center">FOCUSED_LOCKED</td> |
| 1596 | * <td align="center">AF_TRIGGER</td> |
| 1597 | * <td align="center">FOCUSED_LOCKED</td> |
| 1598 | * <td align="center">No effect</td> |
| 1599 | * </tr> |
| 1600 | * <tr> |
| 1601 | * <td align="center">FOCUSED_LOCKED</td> |
| 1602 | * <td align="center">AF_CANCEL</td> |
| 1603 | * <td align="center">INACTIVE</td> |
| 1604 | * <td align="center">Restart AF scan</td> |
| 1605 | * </tr> |
| 1606 | * <tr> |
| 1607 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 1608 | * <td align="center">AF_TRIGGER</td> |
| 1609 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 1610 | * <td align="center">No effect</td> |
| 1611 | * </tr> |
| 1612 | * <tr> |
| 1613 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 1614 | * <td align="center">AF_CANCEL</td> |
| 1615 | * <td align="center">INACTIVE</td> |
| 1616 | * <td align="center">Restart AF scan</td> |
| 1617 | * </tr> |
| 1618 | * </tbody> |
| 1619 | * </table> |
Zhijun He | 60b19dc | 2014-02-24 10:19:20 -0800 | [diff] [blame] | 1620 | * <p>When switch between AF_MODE_CONTINUOUS_* (CAF modes) and AF_MODE_AUTO/AF_MODE_MACRO |
| 1621 | * (AUTO modes), the initial INACTIVE or PASSIVE_SCAN states may be skipped by the |
| 1622 | * camera device. When a trigger is included in a mode switch request, the trigger |
| 1623 | * will be evaluated in the context of the new mode in the request. |
| 1624 | * See below table for examples:</p> |
| 1625 | * <table> |
| 1626 | * <thead> |
| 1627 | * <tr> |
| 1628 | * <th align="center">State</th> |
| 1629 | * <th align="center">Transition Cause</th> |
| 1630 | * <th align="center">New State</th> |
| 1631 | * <th align="center">Notes</th> |
| 1632 | * </tr> |
| 1633 | * </thead> |
| 1634 | * <tbody> |
| 1635 | * <tr> |
| 1636 | * <td align="center">any state</td> |
| 1637 | * <td align="center">CAF-->AUTO mode switch</td> |
| 1638 | * <td align="center">INACTIVE</td> |
| 1639 | * <td align="center">Mode switch without trigger, initial state must be INACTIVE</td> |
| 1640 | * </tr> |
| 1641 | * <tr> |
| 1642 | * <td align="center">any state</td> |
| 1643 | * <td align="center">CAF-->AUTO mode switch with AF_TRIGGER</td> |
| 1644 | * <td align="center">trigger-reachable states from INACTIVE</td> |
| 1645 | * <td align="center">Mode switch with trigger, INACTIVE is skipped</td> |
| 1646 | * </tr> |
| 1647 | * <tr> |
| 1648 | * <td align="center">any state</td> |
| 1649 | * <td align="center">AUTO-->CAF mode switch</td> |
| 1650 | * <td align="center">passively reachable states from INACTIVE</td> |
| 1651 | * <td align="center">Mode switch without trigger, passive transient state is skipped</td> |
| 1652 | * </tr> |
| 1653 | * </tbody> |
| 1654 | * </table> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1655 | * <p><b>Possible values:</b> |
| 1656 | * <ul> |
| 1657 | * <li>{@link #CONTROL_AF_STATE_INACTIVE INACTIVE}</li> |
| 1658 | * <li>{@link #CONTROL_AF_STATE_PASSIVE_SCAN PASSIVE_SCAN}</li> |
| 1659 | * <li>{@link #CONTROL_AF_STATE_PASSIVE_FOCUSED PASSIVE_FOCUSED}</li> |
| 1660 | * <li>{@link #CONTROL_AF_STATE_ACTIVE_SCAN ACTIVE_SCAN}</li> |
| 1661 | * <li>{@link #CONTROL_AF_STATE_FOCUSED_LOCKED FOCUSED_LOCKED}</li> |
| 1662 | * <li>{@link #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED NOT_FOCUSED_LOCKED}</li> |
| 1663 | * <li>{@link #CONTROL_AF_STATE_PASSIVE_UNFOCUSED PASSIVE_UNFOCUSED}</li> |
| 1664 | * </ul></p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1665 | * <p>This key is available on all devices.</p> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 1666 | * |
| 1667 | * @see CaptureRequest#CONTROL_AF_MODE |
| 1668 | * @see CaptureRequest#CONTROL_MODE |
| 1669 | * @see CaptureRequest#CONTROL_SCENE_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1670 | * @see #CONTROL_AF_STATE_INACTIVE |
| 1671 | * @see #CONTROL_AF_STATE_PASSIVE_SCAN |
| 1672 | * @see #CONTROL_AF_STATE_PASSIVE_FOCUSED |
| 1673 | * @see #CONTROL_AF_STATE_ACTIVE_SCAN |
| 1674 | * @see #CONTROL_AF_STATE_FOCUSED_LOCKED |
| 1675 | * @see #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED |
Eino-Ville Talvala | 9f880f7 | 2013-09-20 17:50:41 -0700 | [diff] [blame] | 1676 | * @see #CONTROL_AF_STATE_PASSIVE_UNFOCUSED |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1677 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1678 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1679 | public static final Key<Integer> CONTROL_AF_STATE = |
| 1680 | new Key<Integer>("android.control.afState", int.class); |
| 1681 | |
| 1682 | /** |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 1683 | * <p>Whether auto-white balance (AWB) is currently locked to its |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 1684 | * latest calculated values.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1685 | * <p>When set to <code>true</code> (ON), the AWB algorithm is locked to its latest parameters, |
| 1686 | * and will not change color balance settings until the lock is set to <code>false</code> (OFF).</p> |
| 1687 | * <p>Since the camera device has a pipeline of in-flight requests, the settings that |
| 1688 | * get locked do not necessarily correspond to the settings that were present in the |
| 1689 | * latest capture result received from the camera device, since additional captures |
| 1690 | * and AWB updates may have occurred even before the result was sent out. If an |
| 1691 | * application is switching between automatic and manual control and wishes to eliminate |
| 1692 | * any flicker during the switch, the following procedure is recommended:</p> |
| 1693 | * <ol> |
| 1694 | * <li>Starting in auto-AWB mode:</li> |
| 1695 | * <li>Lock AWB</li> |
| 1696 | * <li>Wait for the first result to be output that has the AWB locked</li> |
| 1697 | * <li>Copy AWB settings from that result into a request, set the request to manual AWB</li> |
| 1698 | * <li>Submit the capture request, proceed to run manual AWB as desired.</li> |
| 1699 | * </ol> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1700 | * <p>Note that AWB lock is only meaningful when |
| 1701 | * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is in the AUTO mode; in other modes, |
| 1702 | * AWB is already fixed to a specific setting.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1703 | * <p>Some LEGACY devices may not support ON; the value is then overridden to OFF.</p> |
| 1704 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1705 | * |
| 1706 | * @see CaptureRequest#CONTROL_AWB_MODE |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 1707 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1708 | @PublicKey |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 1709 | public static final Key<Boolean> CONTROL_AWB_LOCK = |
| 1710 | new Key<Boolean>("android.control.awbLock", boolean.class); |
| 1711 | |
| 1712 | /** |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 1713 | * <p>Whether auto-white balance (AWB) is currently setting the color |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1714 | * transform fields, and what its illumination target |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 1715 | * is.</p> |
Zhijun He | 399f05d | 2014-01-15 11:31:30 -0800 | [diff] [blame] | 1716 | * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is AUTO.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1717 | * <p>When set to the ON mode, the camera device's auto-white balance |
Zhijun He | 399f05d | 2014-01-15 11:31:30 -0800 | [diff] [blame] | 1718 | * routine is enabled, overriding the application's selected |
| 1719 | * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and |
Yin-Chia Yeh | 7144b5d | 2014-11-12 11:42:49 -0800 | [diff] [blame] | 1720 | * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}. Note that when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} |
| 1721 | * is OFF, the behavior of AWB is device dependent. It is recommened to |
| 1722 | * also set AWB mode to OFF or lock AWB by using {@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} before |
| 1723 | * setting AE mode to OFF.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1724 | * <p>When set to the OFF mode, the camera device's auto-white balance |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 1725 | * routine is disabled. The application manually controls the white |
Eino-Ville Talvala | d8fd679 | 2014-02-10 12:41:04 -0800 | [diff] [blame] | 1726 | * balance by {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} |
Zhijun He | 399f05d | 2014-01-15 11:31:30 -0800 | [diff] [blame] | 1727 | * and {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1728 | * <p>When set to any other modes, the camera device's auto-white |
| 1729 | * balance routine is disabled. The camera device uses each |
| 1730 | * particular illumination target for white balance |
| 1731 | * adjustment. The application's values for |
| 1732 | * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, |
| 1733 | * {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and |
| 1734 | * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} are ignored.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1735 | * <p><b>Possible values:</b> |
| 1736 | * <ul> |
| 1737 | * <li>{@link #CONTROL_AWB_MODE_OFF OFF}</li> |
| 1738 | * <li>{@link #CONTROL_AWB_MODE_AUTO AUTO}</li> |
| 1739 | * <li>{@link #CONTROL_AWB_MODE_INCANDESCENT INCANDESCENT}</li> |
| 1740 | * <li>{@link #CONTROL_AWB_MODE_FLUORESCENT FLUORESCENT}</li> |
| 1741 | * <li>{@link #CONTROL_AWB_MODE_WARM_FLUORESCENT WARM_FLUORESCENT}</li> |
| 1742 | * <li>{@link #CONTROL_AWB_MODE_DAYLIGHT DAYLIGHT}</li> |
| 1743 | * <li>{@link #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT CLOUDY_DAYLIGHT}</li> |
| 1744 | * <li>{@link #CONTROL_AWB_MODE_TWILIGHT TWILIGHT}</li> |
| 1745 | * <li>{@link #CONTROL_AWB_MODE_SHADE SHADE}</li> |
| 1746 | * </ul></p> |
| 1747 | * <p><b>Available values for this device:</b><br> |
| 1748 | * {@link CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES android.control.awbAvailableModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1749 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1750 | * |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 1751 | * @see CaptureRequest#COLOR_CORRECTION_GAINS |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 1752 | * @see CaptureRequest#COLOR_CORRECTION_MODE |
| 1753 | * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM |
Yin-Chia Yeh | 7144b5d | 2014-11-12 11:42:49 -0800 | [diff] [blame] | 1754 | * @see CaptureRequest#CONTROL_AE_MODE |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1755 | * @see CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES |
Yin-Chia Yeh | 7144b5d | 2014-11-12 11:42:49 -0800 | [diff] [blame] | 1756 | * @see CaptureRequest#CONTROL_AWB_LOCK |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 1757 | * @see CaptureRequest#CONTROL_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1758 | * @see #CONTROL_AWB_MODE_OFF |
| 1759 | * @see #CONTROL_AWB_MODE_AUTO |
| 1760 | * @see #CONTROL_AWB_MODE_INCANDESCENT |
| 1761 | * @see #CONTROL_AWB_MODE_FLUORESCENT |
| 1762 | * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT |
| 1763 | * @see #CONTROL_AWB_MODE_DAYLIGHT |
| 1764 | * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT |
| 1765 | * @see #CONTROL_AWB_MODE_TWILIGHT |
| 1766 | * @see #CONTROL_AWB_MODE_SHADE |
| 1767 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1768 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1769 | public static final Key<Integer> CONTROL_AWB_MODE = |
| 1770 | new Key<Integer>("android.control.awbMode", int.class); |
| 1771 | |
| 1772 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1773 | * <p>List of metering areas to use for auto-white-balance illuminant |
Ruben Brunk | f59521d | 2014-02-03 17:14:33 -0800 | [diff] [blame] | 1774 | * estimation.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1775 | * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb} is 0. |
Yin-Chia Yeh | 808150f | 2014-09-08 15:48:47 -0700 | [diff] [blame] | 1776 | * Otherwise will always be present.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1777 | * <p>The maximum number of regions supported by the device is determined by the value |
| 1778 | * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb}.</p> |
Yin-Chia Yeh | 6c73e40 | 2018-06-15 15:37:08 -0700 | [diff] [blame] | 1779 | * <p>For devices not supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate |
| 1780 | * system always follows that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with (0,0) being |
| 1781 | * the top-left pixel in the active pixel array, and |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1782 | * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1, |
Yin-Chia Yeh | 6c73e40 | 2018-06-15 15:37:08 -0700 | [diff] [blame] | 1783 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the bottom-right pixel in the |
| 1784 | * active pixel array.</p> |
| 1785 | * <p>For devices supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate |
| 1786 | * system depends on the mode being set. |
| 1787 | * When the distortion correction mode is OFF, the coordinate system follows |
| 1788 | * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, with |
| 1789 | * <code>(0, 0)</code> being the top-left pixel of the pre-correction active array, and |
| 1790 | * ({@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.width - 1, |
| 1791 | * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.height - 1) being the bottom-right |
| 1792 | * pixel in the pre-correction active pixel array. |
| 1793 | * When the distortion correction mode is not OFF, the coordinate system follows |
| 1794 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with |
| 1795 | * <code>(0, 0)</code> being the top-left pixel of the active array, and |
| 1796 | * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1, |
| 1797 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the bottom-right pixel in the |
| 1798 | * active pixel array.</p> |
Yin-Chia Yeh | 97f1c85 | 2014-05-28 16:36:05 -0700 | [diff] [blame] | 1799 | * <p>The weight must range from 0 to 1000, and represents a weight |
| 1800 | * for every pixel in the area. This means that a large metering area |
| 1801 | * with the same weight as a smaller area will have more effect in |
| 1802 | * the metering result. Metering areas can partially overlap and the |
| 1803 | * camera device will add the weights in the overlap region.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1804 | * <p>The weights are relative to weights of other white balance metering regions, so if |
| 1805 | * only one region is used, all non-zero weights will have the same effect. A region with |
| 1806 | * 0 weight is ignored.</p> |
| 1807 | * <p>If all regions have 0 weight, then no specific metering area needs to be used by the |
| 1808 | * camera device.</p> |
| 1809 | * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in |
| 1810 | * capture result metadata, the camera device will ignore the sections outside the crop |
| 1811 | * region and output only the intersection rectangle as the metering region in the result |
| 1812 | * metadata. If the region is entirely outside the crop region, it will be ignored and |
| 1813 | * not reported in the result metadata.</p> |
Yin-Chia Yeh | 6c73e40 | 2018-06-15 15:37:08 -0700 | [diff] [blame] | 1814 | * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} or |
| 1815 | * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} depending on |
| 1816 | * distortion correction capability and mode</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1817 | * <p><b>Range of valid values:</b><br> |
| 1818 | * Coordinates must be between <code>[(0,0), (width, height))</code> of |
Yin-Chia Yeh | 6c73e40 | 2018-06-15 15:37:08 -0700 | [diff] [blame] | 1819 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} or {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} |
| 1820 | * depending on distortion correction capability and mode</p> |
Yin-Chia Yeh | 808150f | 2014-09-08 15:48:47 -0700 | [diff] [blame] | 1821 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1822 | * |
Yin-Chia Yeh | 808150f | 2014-09-08 15:48:47 -0700 | [diff] [blame] | 1823 | * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AWB |
Yin-Chia Yeh | 6c73e40 | 2018-06-15 15:37:08 -0700 | [diff] [blame] | 1824 | * @see CaptureRequest#DISTORTION_CORRECTION_MODE |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1825 | * @see CaptureRequest#SCALER_CROP_REGION |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 1826 | * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE |
Yin-Chia Yeh | 6c73e40 | 2018-06-15 15:37:08 -0700 | [diff] [blame] | 1827 | * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1828 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1829 | @PublicKey |
Yin-Chia Yeh | 817f893 | 2014-05-19 10:23:27 -0700 | [diff] [blame] | 1830 | public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS = |
| 1831 | new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.awbRegions", android.hardware.camera2.params.MeteringRectangle[].class); |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1832 | |
| 1833 | /** |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 1834 | * <p>Information to the camera device 3A (auto-exposure, |
| 1835 | * auto-focus, auto-white balance) routines about the purpose |
| 1836 | * of this capture, to help the camera device to decide optimal 3A |
| 1837 | * strategy.</p> |
| 1838 | * <p>This control (except for MANUAL) is only effective if |
| 1839 | * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF</code> and any 3A routine is active.</p> |
Eino-Ville Talvala | ec99efa | 2017-11-29 15:35:42 -0800 | [diff] [blame] | 1840 | * <p>All intents are supported by all devices, except that: |
| 1841 | * * ZERO_SHUTTER_LAG will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains |
| 1842 | * PRIVATE_REPROCESSING or YUV_REPROCESSING. |
| 1843 | * * MANUAL will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains |
| 1844 | * MANUAL_SENSOR. |
| 1845 | * * MOTION_TRACKING will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains |
| 1846 | * MOTION_TRACKING.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1847 | * <p><b>Possible values:</b> |
| 1848 | * <ul> |
| 1849 | * <li>{@link #CONTROL_CAPTURE_INTENT_CUSTOM CUSTOM}</li> |
| 1850 | * <li>{@link #CONTROL_CAPTURE_INTENT_PREVIEW PREVIEW}</li> |
| 1851 | * <li>{@link #CONTROL_CAPTURE_INTENT_STILL_CAPTURE STILL_CAPTURE}</li> |
| 1852 | * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_RECORD VIDEO_RECORD}</li> |
| 1853 | * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT VIDEO_SNAPSHOT}</li> |
| 1854 | * <li>{@link #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li> |
| 1855 | * <li>{@link #CONTROL_CAPTURE_INTENT_MANUAL MANUAL}</li> |
Eino-Ville Talvala | ec99efa | 2017-11-29 15:35:42 -0800 | [diff] [blame] | 1856 | * <li>{@link #CONTROL_CAPTURE_INTENT_MOTION_TRACKING MOTION_TRACKING}</li> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1857 | * </ul></p> |
| 1858 | * <p>This key is available on all devices.</p> |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 1859 | * |
| 1860 | * @see CaptureRequest#CONTROL_MODE |
| 1861 | * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES |
| 1862 | * @see #CONTROL_CAPTURE_INTENT_CUSTOM |
| 1863 | * @see #CONTROL_CAPTURE_INTENT_PREVIEW |
| 1864 | * @see #CONTROL_CAPTURE_INTENT_STILL_CAPTURE |
| 1865 | * @see #CONTROL_CAPTURE_INTENT_VIDEO_RECORD |
| 1866 | * @see #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT |
| 1867 | * @see #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG |
| 1868 | * @see #CONTROL_CAPTURE_INTENT_MANUAL |
Eino-Ville Talvala | ec99efa | 2017-11-29 15:35:42 -0800 | [diff] [blame] | 1869 | * @see #CONTROL_CAPTURE_INTENT_MOTION_TRACKING |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 1870 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1871 | @PublicKey |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 1872 | public static final Key<Integer> CONTROL_CAPTURE_INTENT = |
| 1873 | new Key<Integer>("android.control.captureIntent", int.class); |
| 1874 | |
| 1875 | /** |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 1876 | * <p>Current state of auto-white balance (AWB) algorithm.</p> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 1877 | * <p>Switching between or enabling AWB modes ({@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}) always |
| 1878 | * resets the AWB state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode}, |
| 1879 | * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all |
| 1880 | * the algorithm states to INACTIVE.</p> |
| 1881 | * <p>The camera device can do several state transitions between two results, if it is |
| 1882 | * allowed by the state transition table. So INACTIVE may never actually be seen in |
| 1883 | * a result.</p> |
| 1884 | * <p>The state in the result is the state for this image (in sync with this image): if |
| 1885 | * AWB state becomes CONVERGED, then the image data associated with this result should |
| 1886 | * be good to use.</p> |
| 1887 | * <p>Below are state transition tables for different AWB modes.</p> |
| 1888 | * <p>When <code>{@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} != AWB_MODE_AUTO</code>:</p> |
| 1889 | * <table> |
| 1890 | * <thead> |
| 1891 | * <tr> |
| 1892 | * <th align="center">State</th> |
| 1893 | * <th align="center">Transition Cause</th> |
| 1894 | * <th align="center">New State</th> |
| 1895 | * <th align="center">Notes</th> |
| 1896 | * </tr> |
| 1897 | * </thead> |
| 1898 | * <tbody> |
| 1899 | * <tr> |
| 1900 | * <td align="center">INACTIVE</td> |
| 1901 | * <td align="center"></td> |
| 1902 | * <td align="center">INACTIVE</td> |
| 1903 | * <td align="center">Camera device auto white balance algorithm is disabled</td> |
| 1904 | * </tr> |
| 1905 | * </tbody> |
| 1906 | * </table> |
| 1907 | * <p>When {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is AWB_MODE_AUTO:</p> |
| 1908 | * <table> |
| 1909 | * <thead> |
| 1910 | * <tr> |
| 1911 | * <th align="center">State</th> |
| 1912 | * <th align="center">Transition Cause</th> |
| 1913 | * <th align="center">New State</th> |
| 1914 | * <th align="center">Notes</th> |
| 1915 | * </tr> |
| 1916 | * </thead> |
| 1917 | * <tbody> |
| 1918 | * <tr> |
| 1919 | * <td align="center">INACTIVE</td> |
| 1920 | * <td align="center">Camera device initiates AWB scan</td> |
| 1921 | * <td align="center">SEARCHING</td> |
| 1922 | * <td align="center">Values changing</td> |
| 1923 | * </tr> |
| 1924 | * <tr> |
| 1925 | * <td align="center">INACTIVE</td> |
| 1926 | * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td> |
| 1927 | * <td align="center">LOCKED</td> |
| 1928 | * <td align="center">Values locked</td> |
| 1929 | * </tr> |
| 1930 | * <tr> |
| 1931 | * <td align="center">SEARCHING</td> |
| 1932 | * <td align="center">Camera device finishes AWB scan</td> |
| 1933 | * <td align="center">CONVERGED</td> |
| 1934 | * <td align="center">Good values, not changing</td> |
| 1935 | * </tr> |
| 1936 | * <tr> |
| 1937 | * <td align="center">SEARCHING</td> |
| 1938 | * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td> |
| 1939 | * <td align="center">LOCKED</td> |
| 1940 | * <td align="center">Values locked</td> |
| 1941 | * </tr> |
| 1942 | * <tr> |
| 1943 | * <td align="center">CONVERGED</td> |
| 1944 | * <td align="center">Camera device initiates AWB scan</td> |
| 1945 | * <td align="center">SEARCHING</td> |
| 1946 | * <td align="center">Values changing</td> |
| 1947 | * </tr> |
| 1948 | * <tr> |
| 1949 | * <td align="center">CONVERGED</td> |
| 1950 | * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td> |
| 1951 | * <td align="center">LOCKED</td> |
| 1952 | * <td align="center">Values locked</td> |
| 1953 | * </tr> |
| 1954 | * <tr> |
| 1955 | * <td align="center">LOCKED</td> |
| 1956 | * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td> |
| 1957 | * <td align="center">SEARCHING</td> |
| 1958 | * <td align="center">Values not good after unlock</td> |
| 1959 | * </tr> |
Zhijun He | 60b19dc | 2014-02-24 10:19:20 -0800 | [diff] [blame] | 1960 | * </tbody> |
| 1961 | * </table> |
| 1962 | * <p>For the above table, the camera device may skip reporting any state changes that happen |
| 1963 | * without application intervention (i.e. mode switch, trigger, locking). Any state that |
| 1964 | * can be skipped in that manner is called a transient state.</p> |
| 1965 | * <p>For example, for this AWB mode (AWB_MODE_AUTO), in addition to the state transitions |
| 1966 | * listed in above table, it is also legal for the camera device to skip one or more |
| 1967 | * transient states between two results. See below table for examples:</p> |
| 1968 | * <table> |
| 1969 | * <thead> |
| 1970 | * <tr> |
| 1971 | * <th align="center">State</th> |
| 1972 | * <th align="center">Transition Cause</th> |
| 1973 | * <th align="center">New State</th> |
| 1974 | * <th align="center">Notes</th> |
| 1975 | * </tr> |
| 1976 | * </thead> |
| 1977 | * <tbody> |
| 1978 | * <tr> |
| 1979 | * <td align="center">INACTIVE</td> |
| 1980 | * <td align="center">Camera device finished AWB scan</td> |
| 1981 | * <td align="center">CONVERGED</td> |
| 1982 | * <td align="center">Values are already good, transient states are skipped by camera device.</td> |
| 1983 | * </tr> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 1984 | * <tr> |
| 1985 | * <td align="center">LOCKED</td> |
| 1986 | * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td> |
| 1987 | * <td align="center">CONVERGED</td> |
Zhijun He | 60b19dc | 2014-02-24 10:19:20 -0800 | [diff] [blame] | 1988 | * <td align="center">Values good after unlock, transient states are skipped by camera device.</td> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 1989 | * </tr> |
| 1990 | * </tbody> |
| 1991 | * </table> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1992 | * <p><b>Possible values:</b> |
| 1993 | * <ul> |
| 1994 | * <li>{@link #CONTROL_AWB_STATE_INACTIVE INACTIVE}</li> |
| 1995 | * <li>{@link #CONTROL_AWB_STATE_SEARCHING SEARCHING}</li> |
| 1996 | * <li>{@link #CONTROL_AWB_STATE_CONVERGED CONVERGED}</li> |
| 1997 | * <li>{@link #CONTROL_AWB_STATE_LOCKED LOCKED}</li> |
| 1998 | * </ul></p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1999 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2000 | * <p><b>Limited capability</b> - |
| 2001 | * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the |
| 2002 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 2003 | * |
| 2004 | * @see CaptureRequest#CONTROL_AWB_LOCK |
| 2005 | * @see CaptureRequest#CONTROL_AWB_MODE |
| 2006 | * @see CaptureRequest#CONTROL_MODE |
| 2007 | * @see CaptureRequest#CONTROL_SCENE_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2008 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2009 | * @see #CONTROL_AWB_STATE_INACTIVE |
| 2010 | * @see #CONTROL_AWB_STATE_SEARCHING |
| 2011 | * @see #CONTROL_AWB_STATE_CONVERGED |
| 2012 | * @see #CONTROL_AWB_STATE_LOCKED |
| 2013 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2014 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2015 | public static final Key<Integer> CONTROL_AWB_STATE = |
| 2016 | new Key<Integer>("android.control.awbState", int.class); |
| 2017 | |
| 2018 | /** |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 2019 | * <p>A special color effect to apply.</p> |
| 2020 | * <p>When this mode is set, a color effect will be applied |
| 2021 | * to images produced by the camera device. The interpretation |
| 2022 | * and implementation of these color effects is left to the |
| 2023 | * implementor of the camera device, and should not be |
| 2024 | * depended on to be consistent (or present) across all |
| 2025 | * devices.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2026 | * <p><b>Possible values:</b> |
| 2027 | * <ul> |
| 2028 | * <li>{@link #CONTROL_EFFECT_MODE_OFF OFF}</li> |
| 2029 | * <li>{@link #CONTROL_EFFECT_MODE_MONO MONO}</li> |
| 2030 | * <li>{@link #CONTROL_EFFECT_MODE_NEGATIVE NEGATIVE}</li> |
| 2031 | * <li>{@link #CONTROL_EFFECT_MODE_SOLARIZE SOLARIZE}</li> |
| 2032 | * <li>{@link #CONTROL_EFFECT_MODE_SEPIA SEPIA}</li> |
| 2033 | * <li>{@link #CONTROL_EFFECT_MODE_POSTERIZE POSTERIZE}</li> |
| 2034 | * <li>{@link #CONTROL_EFFECT_MODE_WHITEBOARD WHITEBOARD}</li> |
| 2035 | * <li>{@link #CONTROL_EFFECT_MODE_BLACKBOARD BLACKBOARD}</li> |
| 2036 | * <li>{@link #CONTROL_EFFECT_MODE_AQUA AQUA}</li> |
| 2037 | * </ul></p> |
| 2038 | * <p><b>Available values for this device:</b><br> |
| 2039 | * {@link CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS android.control.availableEffects}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2040 | * <p>This key is available on all devices.</p> |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 2041 | * |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2042 | * @see CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 2043 | * @see #CONTROL_EFFECT_MODE_OFF |
| 2044 | * @see #CONTROL_EFFECT_MODE_MONO |
| 2045 | * @see #CONTROL_EFFECT_MODE_NEGATIVE |
| 2046 | * @see #CONTROL_EFFECT_MODE_SOLARIZE |
| 2047 | * @see #CONTROL_EFFECT_MODE_SEPIA |
| 2048 | * @see #CONTROL_EFFECT_MODE_POSTERIZE |
| 2049 | * @see #CONTROL_EFFECT_MODE_WHITEBOARD |
| 2050 | * @see #CONTROL_EFFECT_MODE_BLACKBOARD |
| 2051 | * @see #CONTROL_EFFECT_MODE_AQUA |
| 2052 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2053 | @PublicKey |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 2054 | public static final Key<Integer> CONTROL_EFFECT_MODE = |
| 2055 | new Key<Integer>("android.control.effectMode", int.class); |
| 2056 | |
| 2057 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2058 | * <p>Overall mode of 3A (auto-exposure, auto-white-balance, auto-focus) control |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 2059 | * routines.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2060 | * <p>This is a top-level 3A control switch. When set to OFF, all 3A control |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 2061 | * by the camera device is disabled. The application must set the fields for |
Zhijun He | f353742 | 2013-12-16 16:56:35 -0800 | [diff] [blame] | 2062 | * capture parameters itself.</p> |
| 2063 | * <p>When set to AUTO, the individual algorithm controls in |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 2064 | * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p> |
Zhijun He | f353742 | 2013-12-16 16:56:35 -0800 | [diff] [blame] | 2065 | * <p>When set to USE_SCENE_MODE, the individual controls in |
Eino-Ville Talvala | 9dc7ec1 | 2017-11-10 15:23:00 -0800 | [diff] [blame] | 2066 | * android.control.* are mostly disabled, and the camera device |
| 2067 | * implements one of the scene mode settings (such as ACTION, |
| 2068 | * SUNSET, or PARTY) as it wishes. The camera device scene mode |
| 2069 | * 3A settings are provided by {@link android.hardware.camera2.CaptureResult capture results}.</p> |
Zhijun He | 2d5e897 | 2014-02-07 16:13:46 -0800 | [diff] [blame] | 2070 | * <p>When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference |
| 2071 | * is that this frame will not be used by camera device background 3A statistics |
| 2072 | * update, as if this frame is never captured. This mode can be used in the scenario |
| 2073 | * where the application doesn't want a 3A manual control capture to affect |
| 2074 | * the subsequent auto 3A capture results.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2075 | * <p><b>Possible values:</b> |
| 2076 | * <ul> |
| 2077 | * <li>{@link #CONTROL_MODE_OFF OFF}</li> |
| 2078 | * <li>{@link #CONTROL_MODE_AUTO AUTO}</li> |
| 2079 | * <li>{@link #CONTROL_MODE_USE_SCENE_MODE USE_SCENE_MODE}</li> |
| 2080 | * <li>{@link #CONTROL_MODE_OFF_KEEP_STATE OFF_KEEP_STATE}</li> |
| 2081 | * </ul></p> |
Yin-Chia Yeh | d9fc67c | 2015-01-30 10:47:22 -0800 | [diff] [blame] | 2082 | * <p><b>Available values for this device:</b><br> |
| 2083 | * {@link CameraCharacteristics#CONTROL_AVAILABLE_MODES android.control.availableModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2084 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 2085 | * |
| 2086 | * @see CaptureRequest#CONTROL_AF_MODE |
Yin-Chia Yeh | d9fc67c | 2015-01-30 10:47:22 -0800 | [diff] [blame] | 2087 | * @see CameraCharacteristics#CONTROL_AVAILABLE_MODES |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2088 | * @see #CONTROL_MODE_OFF |
| 2089 | * @see #CONTROL_MODE_AUTO |
| 2090 | * @see #CONTROL_MODE_USE_SCENE_MODE |
Zhijun He | 2d5e897 | 2014-02-07 16:13:46 -0800 | [diff] [blame] | 2091 | * @see #CONTROL_MODE_OFF_KEEP_STATE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2092 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2093 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2094 | public static final Key<Integer> CONTROL_MODE = |
| 2095 | new Key<Integer>("android.control.mode", int.class); |
| 2096 | |
| 2097 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2098 | * <p>Control for which scene mode is currently active.</p> |
| 2099 | * <p>Scene modes are custom camera modes optimized for a certain set of conditions and |
| 2100 | * capture settings.</p> |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 2101 | * <p>This is the mode that that is active when |
Zhijun He | ee2ebde | 2015-06-16 19:58:11 -0700 | [diff] [blame] | 2102 | * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code>. Aside from FACE_PRIORITY, these modes will |
| 2103 | * disable {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}, {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, and {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} |
| 2104 | * while in use.</p> |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 2105 | * <p>The interpretation and implementation of these scene modes is left |
| 2106 | * to the implementor of the camera device. Their behavior will not be |
| 2107 | * consistent across all devices, and any given device may only implement |
| 2108 | * a subset of these modes.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2109 | * <p><b>Possible values:</b> |
| 2110 | * <ul> |
| 2111 | * <li>{@link #CONTROL_SCENE_MODE_DISABLED DISABLED}</li> |
| 2112 | * <li>{@link #CONTROL_SCENE_MODE_FACE_PRIORITY FACE_PRIORITY}</li> |
| 2113 | * <li>{@link #CONTROL_SCENE_MODE_ACTION ACTION}</li> |
| 2114 | * <li>{@link #CONTROL_SCENE_MODE_PORTRAIT PORTRAIT}</li> |
| 2115 | * <li>{@link #CONTROL_SCENE_MODE_LANDSCAPE LANDSCAPE}</li> |
| 2116 | * <li>{@link #CONTROL_SCENE_MODE_NIGHT NIGHT}</li> |
| 2117 | * <li>{@link #CONTROL_SCENE_MODE_NIGHT_PORTRAIT NIGHT_PORTRAIT}</li> |
| 2118 | * <li>{@link #CONTROL_SCENE_MODE_THEATRE THEATRE}</li> |
| 2119 | * <li>{@link #CONTROL_SCENE_MODE_BEACH BEACH}</li> |
| 2120 | * <li>{@link #CONTROL_SCENE_MODE_SNOW SNOW}</li> |
| 2121 | * <li>{@link #CONTROL_SCENE_MODE_SUNSET SUNSET}</li> |
| 2122 | * <li>{@link #CONTROL_SCENE_MODE_STEADYPHOTO STEADYPHOTO}</li> |
| 2123 | * <li>{@link #CONTROL_SCENE_MODE_FIREWORKS FIREWORKS}</li> |
| 2124 | * <li>{@link #CONTROL_SCENE_MODE_SPORTS SPORTS}</li> |
| 2125 | * <li>{@link #CONTROL_SCENE_MODE_PARTY PARTY}</li> |
| 2126 | * <li>{@link #CONTROL_SCENE_MODE_CANDLELIGHT CANDLELIGHT}</li> |
| 2127 | * <li>{@link #CONTROL_SCENE_MODE_BARCODE BARCODE}</li> |
| 2128 | * <li>{@link #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO HIGH_SPEED_VIDEO}</li> |
Eino-Ville Talvala | f4eac12 | 2014-12-05 11:10:15 -0800 | [diff] [blame] | 2129 | * <li>{@link #CONTROL_SCENE_MODE_HDR HDR}</li> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2130 | * </ul></p> |
| 2131 | * <p><b>Available values for this device:</b><br> |
| 2132 | * {@link CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES android.control.availableSceneModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2133 | * <p>This key is available on all devices.</p> |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 2134 | * |
| 2135 | * @see CaptureRequest#CONTROL_AE_MODE |
| 2136 | * @see CaptureRequest#CONTROL_AF_MODE |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 2137 | * @see CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 2138 | * @see CaptureRequest#CONTROL_AWB_MODE |
| 2139 | * @see CaptureRequest#CONTROL_MODE |
| 2140 | * @see #CONTROL_SCENE_MODE_DISABLED |
| 2141 | * @see #CONTROL_SCENE_MODE_FACE_PRIORITY |
| 2142 | * @see #CONTROL_SCENE_MODE_ACTION |
| 2143 | * @see #CONTROL_SCENE_MODE_PORTRAIT |
| 2144 | * @see #CONTROL_SCENE_MODE_LANDSCAPE |
| 2145 | * @see #CONTROL_SCENE_MODE_NIGHT |
| 2146 | * @see #CONTROL_SCENE_MODE_NIGHT_PORTRAIT |
| 2147 | * @see #CONTROL_SCENE_MODE_THEATRE |
| 2148 | * @see #CONTROL_SCENE_MODE_BEACH |
| 2149 | * @see #CONTROL_SCENE_MODE_SNOW |
| 2150 | * @see #CONTROL_SCENE_MODE_SUNSET |
| 2151 | * @see #CONTROL_SCENE_MODE_STEADYPHOTO |
| 2152 | * @see #CONTROL_SCENE_MODE_FIREWORKS |
| 2153 | * @see #CONTROL_SCENE_MODE_SPORTS |
| 2154 | * @see #CONTROL_SCENE_MODE_PARTY |
| 2155 | * @see #CONTROL_SCENE_MODE_CANDLELIGHT |
| 2156 | * @see #CONTROL_SCENE_MODE_BARCODE |
Zhijun He | e040418 | 2014-06-26 13:17:09 -0700 | [diff] [blame] | 2157 | * @see #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO |
Eino-Ville Talvala | f4eac12 | 2014-12-05 11:10:15 -0800 | [diff] [blame] | 2158 | * @see #CONTROL_SCENE_MODE_HDR |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 2159 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2160 | @PublicKey |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 2161 | public static final Key<Integer> CONTROL_SCENE_MODE = |
| 2162 | new Key<Integer>("android.control.sceneMode", int.class); |
| 2163 | |
| 2164 | /** |
| 2165 | * <p>Whether video stabilization is |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 2166 | * active.</p> |
Jianing Wei | 2813b0f | 2015-09-29 14:24:36 -0700 | [diff] [blame] | 2167 | * <p>Video stabilization automatically warps images from |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2168 | * the camera in order to stabilize motion between consecutive frames.</p> |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 2169 | * <p>If enabled, video stabilization can modify the |
Zhijun He | 45fa43a1 | 2014-06-13 18:29:37 -0700 | [diff] [blame] | 2170 | * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to keep the video stream stabilized.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2171 | * <p>Switching between different video stabilization modes may take several |
| 2172 | * frames to initialize, the camera device will report the current mode |
| 2173 | * in capture result metadata. For example, When "ON" mode is requested, |
| 2174 | * the video stabilization modes in the first several capture results may |
| 2175 | * still be "OFF", and it will become "ON" when the initialization is |
| 2176 | * done.</p> |
Jianing Wei | 2813b0f | 2015-09-29 14:24:36 -0700 | [diff] [blame] | 2177 | * <p>In addition, not all recording sizes or frame rates may be supported for |
| 2178 | * stabilization by a device that reports stabilization support. It is guaranteed |
| 2179 | * that an output targeting a MediaRecorder or MediaCodec will be stabilized if |
| 2180 | * the recording resolution is less than or equal to 1920 x 1080 (width less than |
| 2181 | * or equal to 1920, height less than or equal to 1080), and the recording |
| 2182 | * frame rate is less than or equal to 30fps. At other sizes, the CaptureResult |
| 2183 | * {@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode} field will return |
| 2184 | * OFF if the recording output is not stabilized, or if there are no output |
| 2185 | * Surface types that can be stabilized.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2186 | * <p>If a camera device supports both this mode and OIS |
| 2187 | * ({@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}), turning both modes on may |
| 2188 | * produce undesirable interaction, so it is recommended not to enable |
| 2189 | * both at the same time.</p> |
| 2190 | * <p><b>Possible values:</b> |
| 2191 | * <ul> |
| 2192 | * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_OFF OFF}</li> |
| 2193 | * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_ON ON}</li> |
| 2194 | * </ul></p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2195 | * <p>This key is available on all devices.</p> |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 2196 | * |
Jianing Wei | 2813b0f | 2015-09-29 14:24:36 -0700 | [diff] [blame] | 2197 | * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE |
Zhijun He | 45fa43a1 | 2014-06-13 18:29:37 -0700 | [diff] [blame] | 2198 | * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 2199 | * @see CaptureRequest#SCALER_CROP_REGION |
| 2200 | * @see #CONTROL_VIDEO_STABILIZATION_MODE_OFF |
| 2201 | * @see #CONTROL_VIDEO_STABILIZATION_MODE_ON |
| 2202 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2203 | @PublicKey |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 2204 | public static final Key<Integer> CONTROL_VIDEO_STABILIZATION_MODE = |
| 2205 | new Key<Integer>("android.control.videoStabilizationMode", int.class); |
| 2206 | |
| 2207 | /** |
Yin-Chia Yeh | 33052d3 | 2016-04-11 16:39:02 -0700 | [diff] [blame] | 2208 | * <p>The amount of additional sensitivity boost applied to output images |
Yin-Chia Yeh | 1ee1a0a | 2016-01-18 19:13:47 -0800 | [diff] [blame] | 2209 | * after RAW sensor data is captured.</p> |
| 2210 | * <p>Some camera devices support additional digital sensitivity boosting in the |
| 2211 | * camera processing pipeline after sensor RAW image is captured. |
| 2212 | * Such a boost will be applied to YUV/JPEG format output images but will not |
| 2213 | * have effect on RAW output formats like RAW_SENSOR, RAW10, RAW12 or RAW_OPAQUE.</p> |
Yin-Chia Yeh | 33052d3 | 2016-04-11 16:39:02 -0700 | [diff] [blame] | 2214 | * <p>This key will be <code>null</code> for devices that do not support any RAW format |
| 2215 | * outputs. For devices that do support RAW format outputs, this key will always |
| 2216 | * present, and if a device does not support post RAW sensitivity boost, it will |
| 2217 | * list <code>100</code> in this key.</p> |
Yin-Chia Yeh | 1ee1a0a | 2016-01-18 19:13:47 -0800 | [diff] [blame] | 2218 | * <p>If the camera device cannot apply the exact boost requested, it will reduce the |
| 2219 | * boost to the nearest supported value. |
| 2220 | * The final boost value used will be available in the output capture result.</p> |
| 2221 | * <p>For devices that support post RAW sensitivity boost, the YUV/JPEG output images |
| 2222 | * of such device will have the total sensitivity of |
Yin-Chia Yeh | 67e61b6 | 2016-01-26 13:27:35 -0800 | [diff] [blame] | 2223 | * <code>{@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity} * {@link CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST android.control.postRawSensitivityBoost} / 100</code> |
Yin-Chia Yeh | 1ee1a0a | 2016-01-18 19:13:47 -0800 | [diff] [blame] | 2224 | * The sensitivity of RAW format images will always be <code>{@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}</code></p> |
| 2225 | * <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 |
| 2226 | * OFF; otherwise the auto-exposure algorithm will override this value.</p> |
| 2227 | * <p><b>Units</b>: ISO arithmetic units, the same as {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}</p> |
| 2228 | * <p><b>Range of valid values:</b><br> |
| 2229 | * {@link CameraCharacteristics#CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE android.control.postRawSensitivityBoostRange}</p> |
| 2230 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2231 | * |
| 2232 | * @see CaptureRequest#CONTROL_AE_MODE |
| 2233 | * @see CaptureRequest#CONTROL_MODE |
| 2234 | * @see CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST |
| 2235 | * @see CameraCharacteristics#CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE |
| 2236 | * @see CaptureRequest#SENSOR_SENSITIVITY |
| 2237 | */ |
| 2238 | @PublicKey |
| 2239 | public static final Key<Integer> CONTROL_POST_RAW_SENSITIVITY_BOOST = |
| 2240 | new Key<Integer>("android.control.postRawSensitivityBoost", int.class); |
| 2241 | |
| 2242 | /** |
Chien-Yu Chen | e449171 | 2017-01-11 11:14:06 -0800 | [diff] [blame] | 2243 | * <p>Allow camera device to enable zero-shutter-lag mode for requests with |
| 2244 | * {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} == STILL_CAPTURE.</p> |
| 2245 | * <p>If enableZsl is <code>true</code>, the camera device may enable zero-shutter-lag mode for requests with |
| 2246 | * STILL_CAPTURE capture intent. The camera device may use images captured in the past to |
| 2247 | * produce output images for a zero-shutter-lag request. The result metadata including the |
| 2248 | * {@link CaptureResult#SENSOR_TIMESTAMP android.sensor.timestamp} reflects the source frames used to produce output images. |
| 2249 | * Therefore, the contents of the output images and the result metadata may be out of order |
| 2250 | * compared to previous regular requests. enableZsl does not affect requests with other |
| 2251 | * capture intents.</p> |
| 2252 | * <p>For example, when requests are submitted in the following order: |
| 2253 | * Request A: enableZsl is ON, {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} is PREVIEW |
| 2254 | * Request B: enableZsl is ON, {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} is STILL_CAPTURE</p> |
| 2255 | * <p>The output images for request B may have contents captured before the output images for |
| 2256 | * request A, and the result metadata for request B may be older than the result metadata for |
| 2257 | * request A.</p> |
Chien-Yu Chen | 1d72ee3 | 2017-04-18 15:23:06 -0700 | [diff] [blame] | 2258 | * <p>Note that when enableZsl is <code>true</code>, it is not guaranteed to get output images captured in |
| 2259 | * the past for requests with STILL_CAPTURE capture intent.</p> |
| 2260 | * <p>For applications targeting SDK versions O and newer, the value of enableZsl in |
| 2261 | * TEMPLATE_STILL_CAPTURE template may be <code>true</code>. The value in other templates is always |
| 2262 | * <code>false</code> if present.</p> |
| 2263 | * <p>For applications targeting SDK versions older than O, the value of enableZsl in all |
| 2264 | * capture templates is always <code>false</code> if present.</p> |
Chien-Yu Chen | 8102638 | 2017-05-03 12:30:58 -0700 | [diff] [blame] | 2265 | * <p>For application-operated ZSL, use CAMERA3_TEMPLATE_ZERO_SHUTTER_LAG template.</p> |
Chien-Yu Chen | e449171 | 2017-01-11 11:14:06 -0800 | [diff] [blame] | 2266 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2267 | * |
| 2268 | * @see CaptureRequest#CONTROL_CAPTURE_INTENT |
| 2269 | * @see CaptureResult#SENSOR_TIMESTAMP |
| 2270 | */ |
| 2271 | @PublicKey |
| 2272 | public static final Key<Boolean> CONTROL_ENABLE_ZSL = |
| 2273 | new Key<Boolean>("android.control.enableZsl", boolean.class); |
| 2274 | |
| 2275 | /** |
Chien-Yu Chen | 2adc8ec | 2017-12-07 14:45:50 -0800 | [diff] [blame] | 2276 | * <p>Whether a significant scene change is detected within the currently-set AF |
| 2277 | * region(s).</p> |
| 2278 | * <p>When the camera focus routine detects a change in the scene it is looking at, |
| 2279 | * such as a large shift in camera viewpoint, significant motion in the scene, or a |
| 2280 | * significant illumination change, this value will be set to DETECTED for a single capture |
| 2281 | * result. Otherwise the value will be NOT_DETECTED. The threshold for detection is similar |
| 2282 | * to what would trigger a new passive focus scan to begin in CONTINUOUS autofocus modes.</p> |
Chien-Yu Chen | 2adc8ec | 2017-12-07 14:45:50 -0800 | [diff] [blame] | 2283 | * <p>This key will be available if the camera device advertises this key via {@link android.hardware.camera2.CameraCharacteristics#getAvailableCaptureResultKeys }.</p> |
Chien-Yu Chen | e8d86eb | 2017-11-27 15:42:44 -0800 | [diff] [blame] | 2284 | * <p><b>Possible values:</b> |
| 2285 | * <ul> |
| 2286 | * <li>{@link #CONTROL_AF_SCENE_CHANGE_NOT_DETECTED NOT_DETECTED}</li> |
| 2287 | * <li>{@link #CONTROL_AF_SCENE_CHANGE_DETECTED DETECTED}</li> |
| 2288 | * </ul></p> |
| 2289 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2290 | * @see #CONTROL_AF_SCENE_CHANGE_NOT_DETECTED |
| 2291 | * @see #CONTROL_AF_SCENE_CHANGE_DETECTED |
| 2292 | */ |
| 2293 | @PublicKey |
| 2294 | public static final Key<Integer> CONTROL_AF_SCENE_CHANGE = |
| 2295 | new Key<Integer>("android.control.afSceneChange", int.class); |
| 2296 | |
| 2297 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2298 | * <p>Operation mode for edge |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 2299 | * enhancement.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2300 | * <p>Edge enhancement improves sharpness and details in the captured image. OFF means |
| 2301 | * no enhancement will be applied by the camera device.</p> |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 2302 | * <p>FAST/HIGH_QUALITY both mean camera device determined enhancement |
Zhijun He | 2807936 | 2013-12-17 10:35:40 -0800 | [diff] [blame] | 2303 | * will be applied. HIGH_QUALITY mode indicates that the |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 2304 | * camera device will use the highest-quality enhancement algorithms, |
| 2305 | * even if it slows down capture rate. FAST means the camera device will |
Chien-Yu Chen | 9c9167e | 2015-07-14 16:38:25 -0700 | [diff] [blame] | 2306 | * not slow down capture rate when applying edge enhancement. FAST may be the same as OFF if |
| 2307 | * edge enhancement will slow down capture rate. Every output stream will have a similar |
| 2308 | * amount of enhancement applied.</p> |
Eino-Ville Talvala | 0dd1750 | 2015-07-07 10:43:07 -0700 | [diff] [blame] | 2309 | * <p>ZERO_SHUTTER_LAG is meant to be used by applications that maintain a continuous circular |
| 2310 | * buffer of high-resolution images during preview and reprocess image(s) from that buffer |
| 2311 | * into a final capture when triggered by the user. In this mode, the camera device applies |
| 2312 | * edge enhancement to low-resolution streams (below maximum recording resolution) to |
| 2313 | * maximize preview quality, but does not apply edge enhancement to high-resolution streams, |
| 2314 | * since those will be reprocessed later if necessary.</p> |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 2315 | * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera |
| 2316 | * device will apply FAST/HIGH_QUALITY YUV-domain edge enhancement, respectively. |
Chien-Yu Chen | 9c9167e | 2015-07-14 16:38:25 -0700 | [diff] [blame] | 2317 | * The camera device may adjust its internal edge enhancement parameters for best |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 2318 | * image quality based on the {@link CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR android.reprocess.effectiveExposureFactor}, if it is set.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2319 | * <p><b>Possible values:</b> |
| 2320 | * <ul> |
| 2321 | * <li>{@link #EDGE_MODE_OFF OFF}</li> |
| 2322 | * <li>{@link #EDGE_MODE_FAST FAST}</li> |
| 2323 | * <li>{@link #EDGE_MODE_HIGH_QUALITY HIGH_QUALITY}</li> |
Eino-Ville Talvala | 0dd1750 | 2015-07-07 10:43:07 -0700 | [diff] [blame] | 2324 | * <li>{@link #EDGE_MODE_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2325 | * </ul></p> |
| 2326 | * <p><b>Available values for this device:</b><br> |
| 2327 | * {@link CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES android.edge.availableEdgeModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2328 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2329 | * <p><b>Full capability</b> - |
| 2330 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 2331 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Ruben Brunk | 6dc379c | 2014-03-04 15:04:00 -0800 | [diff] [blame] | 2332 | * |
| 2333 | * @see CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2334 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 2335 | * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2336 | * @see #EDGE_MODE_OFF |
| 2337 | * @see #EDGE_MODE_FAST |
| 2338 | * @see #EDGE_MODE_HIGH_QUALITY |
Eino-Ville Talvala | 0dd1750 | 2015-07-07 10:43:07 -0700 | [diff] [blame] | 2339 | * @see #EDGE_MODE_ZERO_SHUTTER_LAG |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2340 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2341 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2342 | public static final Key<Integer> EDGE_MODE = |
| 2343 | new Key<Integer>("android.edge.mode", int.class); |
| 2344 | |
| 2345 | /** |
Zhijun He | 66d065a | 2014-01-16 18:18:50 -0800 | [diff] [blame] | 2346 | * <p>The desired mode for for the camera device's flash control.</p> |
| 2347 | * <p>This control is only effective when flash unit is available |
Zhijun He | 153ac10 | 2014-02-03 12:25:12 -0800 | [diff] [blame] | 2348 | * (<code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == true</code>).</p> |
Zhijun He | 66d065a | 2014-01-16 18:18:50 -0800 | [diff] [blame] | 2349 | * <p>When this control is used, the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} must be set to ON or OFF. |
| 2350 | * Otherwise, the camera device auto-exposure related flash control (ON_AUTO_FLASH, |
| 2351 | * ON_ALWAYS_FLASH, or ON_AUTO_FLASH_REDEYE) will override this control.</p> |
| 2352 | * <p>When set to OFF, the camera device will not fire flash for this capture.</p> |
| 2353 | * <p>When set to SINGLE, the camera device will fire flash regardless of the camera |
| 2354 | * device's auto-exposure routine's result. When used in still capture case, this |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 2355 | * control should be used along with auto-exposure (AE) precapture metering sequence |
Zhijun He | 66d065a | 2014-01-16 18:18:50 -0800 | [diff] [blame] | 2356 | * ({@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}), otherwise, the image may be incorrectly exposed.</p> |
| 2357 | * <p>When set to TORCH, the flash will be on continuously. This mode can be used |
| 2358 | * for use cases such as preview, auto-focus assist, still capture, or video recording.</p> |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 2359 | * <p>The flash status will be reported by {@link CaptureResult#FLASH_STATE android.flash.state} in the capture result metadata.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2360 | * <p><b>Possible values:</b> |
| 2361 | * <ul> |
| 2362 | * <li>{@link #FLASH_MODE_OFF OFF}</li> |
| 2363 | * <li>{@link #FLASH_MODE_SINGLE SINGLE}</li> |
| 2364 | * <li>{@link #FLASH_MODE_TORCH TORCH}</li> |
| 2365 | * </ul></p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2366 | * <p>This key is available on all devices.</p> |
Zhijun He | 66d065a | 2014-01-16 18:18:50 -0800 | [diff] [blame] | 2367 | * |
| 2368 | * @see CaptureRequest#CONTROL_AE_MODE |
| 2369 | * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER |
| 2370 | * @see CameraCharacteristics#FLASH_INFO_AVAILABLE |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 2371 | * @see CaptureResult#FLASH_STATE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2372 | * @see #FLASH_MODE_OFF |
| 2373 | * @see #FLASH_MODE_SINGLE |
| 2374 | * @see #FLASH_MODE_TORCH |
| 2375 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2376 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2377 | public static final Key<Integer> FLASH_MODE = |
| 2378 | new Key<Integer>("android.flash.mode", int.class); |
| 2379 | |
| 2380 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2381 | * <p>Current state of the flash |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 2382 | * unit.</p> |
| 2383 | * <p>When the camera device doesn't have flash unit |
| 2384 | * (i.e. <code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == false</code>), this state will always be UNAVAILABLE. |
| 2385 | * Other states indicate the current flash status.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2386 | * <p>In certain conditions, this will be available on LEGACY devices:</p> |
| 2387 | * <ul> |
| 2388 | * <li>Flash-less cameras always return UNAVAILABLE.</li> |
| 2389 | * <li>Using {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>==</code> ON_ALWAYS_FLASH |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2390 | * will always return FIRED.</li> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2391 | * <li>Using {@link CaptureRequest#FLASH_MODE android.flash.mode} <code>==</code> TORCH |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2392 | * will always return FIRED.</li> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2393 | * </ul> |
| 2394 | * <p>In all other conditions the state will not be available on |
| 2395 | * LEGACY devices (i.e. it will be <code>null</code>).</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2396 | * <p><b>Possible values:</b> |
| 2397 | * <ul> |
| 2398 | * <li>{@link #FLASH_STATE_UNAVAILABLE UNAVAILABLE}</li> |
| 2399 | * <li>{@link #FLASH_STATE_CHARGING CHARGING}</li> |
| 2400 | * <li>{@link #FLASH_STATE_READY READY}</li> |
| 2401 | * <li>{@link #FLASH_STATE_FIRED FIRED}</li> |
| 2402 | * <li>{@link #FLASH_STATE_PARTIAL PARTIAL}</li> |
| 2403 | * </ul></p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2404 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2405 | * <p><b>Limited capability</b> - |
| 2406 | * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the |
| 2407 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 2408 | * |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2409 | * @see CaptureRequest#CONTROL_AE_MODE |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 2410 | * @see CameraCharacteristics#FLASH_INFO_AVAILABLE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2411 | * @see CaptureRequest#FLASH_MODE |
| 2412 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2413 | * @see #FLASH_STATE_UNAVAILABLE |
| 2414 | * @see #FLASH_STATE_CHARGING |
| 2415 | * @see #FLASH_STATE_READY |
| 2416 | * @see #FLASH_STATE_FIRED |
Zhijun He | 8dda727 | 2014-03-25 13:49:30 -0700 | [diff] [blame] | 2417 | * @see #FLASH_STATE_PARTIAL |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2418 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2419 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2420 | public static final Key<Integer> FLASH_STATE = |
| 2421 | new Key<Integer>("android.flash.state", int.class); |
| 2422 | |
| 2423 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2424 | * <p>Operational mode for hot pixel correction.</p> |
Ruben Brunk | eba1b3a | 2014-02-07 18:23:50 -0800 | [diff] [blame] | 2425 | * <p>Hotpixel correction interpolates out, or otherwise removes, pixels |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2426 | * that do not accurately measure the incoming light (i.e. pixels that |
| 2427 | * are stuck at an arbitrary value or are oversensitive).</p> |
| 2428 | * <p><b>Possible values:</b> |
| 2429 | * <ul> |
| 2430 | * <li>{@link #HOT_PIXEL_MODE_OFF OFF}</li> |
| 2431 | * <li>{@link #HOT_PIXEL_MODE_FAST FAST}</li> |
| 2432 | * <li>{@link #HOT_PIXEL_MODE_HIGH_QUALITY HIGH_QUALITY}</li> |
| 2433 | * </ul></p> |
| 2434 | * <p><b>Available values for this device:</b><br> |
| 2435 | * {@link CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES android.hotPixel.availableHotPixelModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2436 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
Ruben Brunk | 9d454fd | 2014-03-04 14:11:52 -0800 | [diff] [blame] | 2437 | * |
| 2438 | * @see CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES |
Ruben Brunk | eba1b3a | 2014-02-07 18:23:50 -0800 | [diff] [blame] | 2439 | * @see #HOT_PIXEL_MODE_OFF |
| 2440 | * @see #HOT_PIXEL_MODE_FAST |
| 2441 | * @see #HOT_PIXEL_MODE_HIGH_QUALITY |
| 2442 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2443 | @PublicKey |
Ruben Brunk | eba1b3a | 2014-02-07 18:23:50 -0800 | [diff] [blame] | 2444 | public static final Key<Integer> HOT_PIXEL_MODE = |
| 2445 | new Key<Integer>("android.hotPixel.mode", int.class); |
| 2446 | |
| 2447 | /** |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 2448 | * <p>A location object to use when generating image GPS metadata.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2449 | * <p>Setting a location object in a request will include the GPS coordinates of the location |
| 2450 | * into any JPEG images captured based on the request. These coordinates can then be |
| 2451 | * viewed by anyone who receives the JPEG image.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2452 | * <p>This key is available on all devices.</p> |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 2453 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2454 | @PublicKey |
| 2455 | @SyntheticKey |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 2456 | public static final Key<android.location.Location> JPEG_GPS_LOCATION = |
| 2457 | new Key<android.location.Location>("android.jpeg.gpsLocation", android.location.Location.class); |
| 2458 | |
| 2459 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2460 | * <p>GPS coordinates to include in output JPEG |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2461 | * EXIF.</p> |
| 2462 | * <p><b>Range of valid values:</b><br> |
| 2463 | * (-180 - 180], [-90,90], [-inf, inf]</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2464 | * <p>This key is available on all devices.</p> |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 2465 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2466 | */ |
Mathew Inwood | bcbe440 | 2018-08-08 15:42:59 +0100 | [diff] [blame^] | 2467 | @UnsupportedAppUsage |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2468 | public static final Key<double[]> JPEG_GPS_COORDINATES = |
| 2469 | new Key<double[]>("android.jpeg.gpsCoordinates", double[].class); |
| 2470 | |
| 2471 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2472 | * <p>32 characters describing GPS algorithm to |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2473 | * include in EXIF.</p> |
| 2474 | * <p><b>Units</b>: UTF-8 null-terminated string</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2475 | * <p>This key is available on all devices.</p> |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 2476 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2477 | */ |
Mathew Inwood | bcbe440 | 2018-08-08 15:42:59 +0100 | [diff] [blame^] | 2478 | @UnsupportedAppUsage |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2479 | public static final Key<String> JPEG_GPS_PROCESSING_METHOD = |
| 2480 | new Key<String>("android.jpeg.gpsProcessingMethod", String.class); |
| 2481 | |
| 2482 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2483 | * <p>Time GPS fix was made to include in |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2484 | * EXIF.</p> |
| 2485 | * <p><b>Units</b>: UTC in seconds since January 1, 1970</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2486 | * <p>This key is available on all devices.</p> |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 2487 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2488 | */ |
Mathew Inwood | bcbe440 | 2018-08-08 15:42:59 +0100 | [diff] [blame^] | 2489 | @UnsupportedAppUsage |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2490 | public static final Key<Long> JPEG_GPS_TIMESTAMP = |
| 2491 | new Key<Long>("android.jpeg.gpsTimestamp", long.class); |
| 2492 | |
| 2493 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2494 | * <p>The orientation for a JPEG image.</p> |
| 2495 | * <p>The clockwise rotation angle in degrees, relative to the orientation |
| 2496 | * to the camera, that the JPEG picture needs to be rotated by, to be viewed |
| 2497 | * upright.</p> |
| 2498 | * <p>Camera devices may either encode this value into the JPEG EXIF header, or |
Yin-Chia Yeh | d49ebcc | 2015-03-27 13:54:04 -0700 | [diff] [blame] | 2499 | * rotate the image data to match this orientation. When the image data is rotated, |
| 2500 | * the thumbnail data will also be rotated.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2501 | * <p>Note that this orientation is relative to the orientation of the camera sensor, given |
| 2502 | * by {@link CameraCharacteristics#SENSOR_ORIENTATION android.sensor.orientation}.</p> |
Emilian Peev | 3abc751 | 2018-03-28 11:22:26 +0100 | [diff] [blame] | 2503 | * <p>To translate from the device orientation given by the Android sensor APIs for camera |
| 2504 | * sensors which are not EXTERNAL, the following sample code may be used:</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2505 | * <pre><code>private int getJpegOrientation(CameraCharacteristics c, int deviceOrientation) { |
| 2506 | * if (deviceOrientation == android.view.OrientationEventListener.ORIENTATION_UNKNOWN) return 0; |
| 2507 | * int sensorOrientation = c.get(CameraCharacteristics.SENSOR_ORIENTATION); |
| 2508 | * |
| 2509 | * // Round device orientation to a multiple of 90 |
| 2510 | * deviceOrientation = (deviceOrientation + 45) / 90 * 90; |
| 2511 | * |
| 2512 | * // Reverse device orientation for front-facing cameras |
| 2513 | * boolean facingFront = c.get(CameraCharacteristics.LENS_FACING) == CameraCharacteristics.LENS_FACING_FRONT; |
| 2514 | * if (facingFront) deviceOrientation = -deviceOrientation; |
| 2515 | * |
| 2516 | * // Calculate desired JPEG orientation relative to camera orientation to make |
| 2517 | * // the image upright relative to the device orientation |
| 2518 | * int jpegOrientation = (sensorOrientation + deviceOrientation + 360) % 360; |
| 2519 | * |
| 2520 | * return jpegOrientation; |
| 2521 | * } |
| 2522 | * </code></pre> |
Emilian Peev | 3abc751 | 2018-03-28 11:22:26 +0100 | [diff] [blame] | 2523 | * <p>For EXTERNAL cameras the sensor orientation will always be set to 0 and the facing will |
| 2524 | * also be set to EXTERNAL. The above code is not relevant in such case.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2525 | * <p><b>Units</b>: Degrees in multiples of 90</p> |
| 2526 | * <p><b>Range of valid values:</b><br> |
| 2527 | * 0, 90, 180, 270</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2528 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2529 | * |
| 2530 | * @see CameraCharacteristics#SENSOR_ORIENTATION |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2531 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2532 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2533 | public static final Key<Integer> JPEG_ORIENTATION = |
| 2534 | new Key<Integer>("android.jpeg.orientation", int.class); |
| 2535 | |
| 2536 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2537 | * <p>Compression quality of the final JPEG |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 2538 | * image.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 2539 | * <p>85-95 is typical usage range.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2540 | * <p><b>Range of valid values:</b><br> |
| 2541 | * 1-100; larger is higher quality</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2542 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2543 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2544 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2545 | public static final Key<Byte> JPEG_QUALITY = |
| 2546 | new Key<Byte>("android.jpeg.quality", byte.class); |
| 2547 | |
| 2548 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2549 | * <p>Compression quality of JPEG |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 2550 | * thumbnail.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2551 | * <p><b>Range of valid values:</b><br> |
| 2552 | * 1-100; larger is higher quality</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2553 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2554 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2555 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2556 | public static final Key<Byte> JPEG_THUMBNAIL_QUALITY = |
| 2557 | new Key<Byte>("android.jpeg.thumbnailQuality", byte.class); |
| 2558 | |
| 2559 | /** |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 2560 | * <p>Resolution of embedded JPEG thumbnail.</p> |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 2561 | * <p>When set to (0, 0) value, the JPEG EXIF will not contain thumbnail, |
| 2562 | * but the captured JPEG will still be a valid image.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2563 | * <p>For best results, when issuing a request for a JPEG image, the thumbnail size selected |
| 2564 | * should have the same aspect ratio as the main JPEG output.</p> |
Zhijun He | 50f7243 | 2014-05-28 13:52:04 -0700 | [diff] [blame] | 2565 | * <p>If the thumbnail image aspect ratio differs from the JPEG primary image aspect |
| 2566 | * ratio, the camera device creates the thumbnail by cropping it from the primary image. |
| 2567 | * For example, if the primary image has 4:3 aspect ratio, the thumbnail image has |
| 2568 | * 16:9 aspect ratio, the primary image will be cropped vertically (letterbox) to |
| 2569 | * generate the thumbnail image. The thumbnail image will always have a smaller Field |
| 2570 | * Of View (FOV) than the primary image when aspect ratios differ.</p> |
Yin-Chia Yeh | 5988311 | 2015-06-22 15:51:40 -0700 | [diff] [blame] | 2571 | * <p>When an {@link CaptureRequest#JPEG_ORIENTATION android.jpeg.orientation} of non-zero degree is requested, |
| 2572 | * the camera device will handle thumbnail rotation in one of the following ways:</p> |
| 2573 | * <ul> |
| 2574 | * <li>Set the {@link android.media.ExifInterface#TAG_ORIENTATION EXIF orientation flag} |
| 2575 | * and keep jpeg and thumbnail image data unrotated.</li> |
| 2576 | * <li>Rotate the jpeg and thumbnail image data and not set |
| 2577 | * {@link android.media.ExifInterface#TAG_ORIENTATION EXIF orientation flag}. In this |
| 2578 | * case, LIMITED or FULL hardware level devices will report rotated thumnail size in |
| 2579 | * capture result, so the width and height will be interchanged if 90 or 270 degree |
| 2580 | * orientation is requested. LEGACY device will always report unrotated thumbnail |
| 2581 | * size.</li> |
| 2582 | * </ul> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2583 | * <p><b>Range of valid values:</b><br> |
| 2584 | * {@link CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES android.jpeg.availableThumbnailSizes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2585 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2586 | * |
| 2587 | * @see CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES |
Yin-Chia Yeh | 5988311 | 2015-06-22 15:51:40 -0700 | [diff] [blame] | 2588 | * @see CaptureRequest#JPEG_ORIENTATION |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2589 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2590 | @PublicKey |
Igor Murashkin | 72f9f0a | 2014-05-14 15:46:10 -0700 | [diff] [blame] | 2591 | public static final Key<android.util.Size> JPEG_THUMBNAIL_SIZE = |
| 2592 | new Key<android.util.Size>("android.jpeg.thumbnailSize", android.util.Size.class); |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2593 | |
| 2594 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2595 | * <p>The desired lens aperture size, as a ratio of lens focal length to the |
| 2596 | * effective aperture diameter.</p> |
| 2597 | * <p>Setting this value is only supported on the camera devices that have a variable |
| 2598 | * aperture lens.</p> |
Zhijun He | fb46c64 | 2014-01-14 17:57:23 -0800 | [diff] [blame] | 2599 | * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF, |
| 2600 | * this can be set along with {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}, |
Eino-Ville Talvala | d8fd679 | 2014-02-10 12:41:04 -0800 | [diff] [blame] | 2601 | * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} |
Zhijun He | fb46c64 | 2014-01-14 17:57:23 -0800 | [diff] [blame] | 2602 | * to achieve manual exposure control.</p> |
| 2603 | * <p>The requested aperture value may take several frames to reach the |
| 2604 | * requested value; the camera device will report the current (intermediate) |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 2605 | * aperture size in capture result metadata while the aperture is changing. |
| 2606 | * While the aperture is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p> |
Zhijun He | fb46c64 | 2014-01-14 17:57:23 -0800 | [diff] [blame] | 2607 | * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of |
| 2608 | * the ON modes, this will be overridden by the camera device |
| 2609 | * auto-exposure algorithm, the overridden values are then provided |
| 2610 | * back to the user in the corresponding result.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2611 | * <p><b>Units</b>: The f-number (f/N)</p> |
| 2612 | * <p><b>Range of valid values:</b><br> |
| 2613 | * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2614 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2615 | * <p><b>Full capability</b> - |
| 2616 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 2617 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Zhijun He | fb46c64 | 2014-01-14 17:57:23 -0800 | [diff] [blame] | 2618 | * |
Zhijun He | 399f05d | 2014-01-15 11:31:30 -0800 | [diff] [blame] | 2619 | * @see CaptureRequest#CONTROL_AE_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2620 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 2621 | * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 2622 | * @see CaptureResult#LENS_STATE |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 2623 | * @see CaptureRequest#SENSOR_EXPOSURE_TIME |
Eino-Ville Talvala | d8fd679 | 2014-02-10 12:41:04 -0800 | [diff] [blame] | 2624 | * @see CaptureRequest#SENSOR_FRAME_DURATION |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 2625 | * @see CaptureRequest#SENSOR_SENSITIVITY |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2626 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2627 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2628 | public static final Key<Float> LENS_APERTURE = |
| 2629 | new Key<Float>("android.lens.aperture", float.class); |
| 2630 | |
| 2631 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2632 | * <p>The desired setting for the lens neutral density filter(s).</p> |
| 2633 | * <p>This control will not be supported on most camera devices.</p> |
Ruben Brunk | 855bae4 | 2014-01-17 10:30:32 -0800 | [diff] [blame] | 2634 | * <p>Lens filters are typically used to lower the amount of light the |
| 2635 | * sensor is exposed to (measured in steps of EV). As used here, an EV |
| 2636 | * step is the standard logarithmic representation, which are |
| 2637 | * non-negative, and inversely proportional to the amount of light |
| 2638 | * hitting the sensor. For example, setting this to 0 would result |
| 2639 | * in no reduction of the incoming light, and setting this to 2 would |
| 2640 | * mean that the filter is set to reduce incoming light by two stops |
| 2641 | * (allowing 1/4 of the prior amount of light to the sensor).</p> |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 2642 | * <p>It may take several frames before the lens filter density changes |
| 2643 | * to the requested value. While the filter density is still changing, |
| 2644 | * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2645 | * <p><b>Units</b>: Exposure Value (EV)</p> |
| 2646 | * <p><b>Range of valid values:</b><br> |
| 2647 | * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2648 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2649 | * <p><b>Full capability</b> - |
| 2650 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 2651 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Ruben Brunk | 855bae4 | 2014-01-17 10:30:32 -0800 | [diff] [blame] | 2652 | * |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2653 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Ruben Brunk | 855bae4 | 2014-01-17 10:30:32 -0800 | [diff] [blame] | 2654 | * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 2655 | * @see CaptureResult#LENS_STATE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2656 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2657 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2658 | public static final Key<Float> LENS_FILTER_DENSITY = |
| 2659 | new Key<Float>("android.lens.filterDensity", float.class); |
| 2660 | |
| 2661 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2662 | * <p>The desired lens focal length; used for optical zoom.</p> |
Ruben Brunk | a20f4c2 | 2014-01-17 15:21:13 -0800 | [diff] [blame] | 2663 | * <p>This setting controls the physical focal length of the camera |
| 2664 | * device's lens. Changing the focal length changes the field of |
| 2665 | * view of the camera device, and is usually used for optical zoom.</p> |
| 2666 | * <p>Like {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, this |
| 2667 | * setting won't be applied instantaneously, and it may take several |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 2668 | * frames before the lens can change to the requested focal length. |
Ruben Brunk | a20f4c2 | 2014-01-17 15:21:13 -0800 | [diff] [blame] | 2669 | * While the focal length is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will |
| 2670 | * be set to MOVING.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2671 | * <p>Optical zoom will not be supported on most devices.</p> |
| 2672 | * <p><b>Units</b>: Millimeters</p> |
| 2673 | * <p><b>Range of valid values:</b><br> |
| 2674 | * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2675 | * <p>This key is available on all devices.</p> |
Ruben Brunk | a20f4c2 | 2014-01-17 15:21:13 -0800 | [diff] [blame] | 2676 | * |
| 2677 | * @see CaptureRequest#LENS_APERTURE |
| 2678 | * @see CaptureRequest#LENS_FOCUS_DISTANCE |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2679 | * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS |
Ruben Brunk | a20f4c2 | 2014-01-17 15:21:13 -0800 | [diff] [blame] | 2680 | * @see CaptureResult#LENS_STATE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2681 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2682 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2683 | public static final Key<Float> LENS_FOCAL_LENGTH = |
| 2684 | new Key<Float>("android.lens.focalLength", float.class); |
| 2685 | |
| 2686 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2687 | * <p>Desired distance to plane of sharpest focus, |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 2688 | * measured from frontmost surface of the lens.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2689 | * <p>Should be zero for fixed-focus cameras</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2690 | * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p> |
| 2691 | * <p><b>Range of valid values:</b><br> |
| 2692 | * >= 0</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2693 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2694 | * <p><b>Full capability</b> - |
| 2695 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 2696 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
| 2697 | * |
| 2698 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2699 | * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2700 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2701 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2702 | public static final Key<Float> LENS_FOCUS_DISTANCE = |
| 2703 | new Key<Float>("android.lens.focusDistance", float.class); |
| 2704 | |
| 2705 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2706 | * <p>The range of scene distances that are in |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 2707 | * sharp focus (depth of field).</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2708 | * <p>If variable focus not supported, can still report |
| 2709 | * fixed depth of field range</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2710 | * <p><b>Units</b>: A pair of focus distances in diopters: (near, |
| 2711 | * far); see {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details.</p> |
| 2712 | * <p><b>Range of valid values:</b><br> |
| 2713 | * >=0</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2714 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2715 | * <p><b>Limited capability</b> - |
| 2716 | * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the |
| 2717 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
| 2718 | * |
| 2719 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2720 | * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2721 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2722 | @PublicKey |
Igor Murashkin | 5743868 | 2014-05-30 10:49:00 -0700 | [diff] [blame] | 2723 | public static final Key<android.util.Pair<Float,Float>> LENS_FOCUS_RANGE = |
| 2724 | new Key<android.util.Pair<Float,Float>>("android.lens.focusRange", new TypeReference<android.util.Pair<Float,Float>>() {{ }}); |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2725 | |
| 2726 | /** |
Ruben Brunk | 00849b3 | 2014-01-17 18:30:23 -0800 | [diff] [blame] | 2727 | * <p>Sets whether the camera device uses optical image stabilization (OIS) |
| 2728 | * when capturing images.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 2729 | * <p>OIS is used to compensate for motion blur due to small |
| 2730 | * movements of the camera during capture. Unlike digital image |
| 2731 | * stabilization ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), OIS |
| 2732 | * makes use of mechanical elements to stabilize the camera |
| 2733 | * sensor, and thus allows for longer exposure times before |
| 2734 | * camera shake becomes apparent.</p> |
Zhijun He | 45fa43a1 | 2014-06-13 18:29:37 -0700 | [diff] [blame] | 2735 | * <p>Switching between different optical stabilization modes may take several |
| 2736 | * frames to initialize, the camera device will report the current mode in |
| 2737 | * capture result metadata. For example, When "ON" mode is requested, the |
| 2738 | * optical stabilization modes in the first several capture results may still |
| 2739 | * be "OFF", and it will become "ON" when the initialization is done.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2740 | * <p>If a camera device supports both OIS and digital image stabilization |
| 2741 | * ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), turning both modes on may produce undesirable |
| 2742 | * interaction, so it is recommended not to enable both at the same time.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 2743 | * <p>Not all devices will support OIS; see |
| 2744 | * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization} for |
| 2745 | * available controls.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2746 | * <p><b>Possible values:</b> |
| 2747 | * <ul> |
| 2748 | * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_OFF OFF}</li> |
| 2749 | * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_ON ON}</li> |
| 2750 | * </ul></p> |
| 2751 | * <p><b>Available values for this device:</b><br> |
| 2752 | * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2753 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2754 | * <p><b>Limited capability</b> - |
| 2755 | * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the |
| 2756 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 2757 | * |
| 2758 | * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2759 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 2760 | * @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2761 | * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF |
| 2762 | * @see #LENS_OPTICAL_STABILIZATION_MODE_ON |
| 2763 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2764 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2765 | public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE = |
| 2766 | new Key<Integer>("android.lens.opticalStabilizationMode", int.class); |
| 2767 | |
| 2768 | /** |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 2769 | * <p>Current lens status.</p> |
| 2770 | * <p>For lens parameters {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}, {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance}, |
| 2771 | * {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, when changes are requested, |
| 2772 | * they may take several frames to reach the requested values. This state indicates |
| 2773 | * the current status of the lens parameters.</p> |
| 2774 | * <p>When the state is STATIONARY, the lens parameters are not changing. This could be |
| 2775 | * either because the parameters are all fixed, or because the lens has had enough |
| 2776 | * time to reach the most recently-requested values. |
| 2777 | * If all these lens parameters are not changable for a camera device, as listed below:</p> |
| 2778 | * <ul> |
| 2779 | * <li>Fixed focus (<code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} == 0</code>), which means |
| 2780 | * {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} parameter will always be 0.</li> |
| 2781 | * <li>Fixed focal length ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths} contains single value), |
| 2782 | * which means the optical zoom is not supported.</li> |
| 2783 | * <li>No ND filter ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities} contains only 0).</li> |
| 2784 | * <li>Fixed aperture ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures} contains single value).</li> |
| 2785 | * </ul> |
| 2786 | * <p>Then this state will always be STATIONARY.</p> |
| 2787 | * <p>When the state is MOVING, it indicates that at least one of the lens parameters |
| 2788 | * is changing.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2789 | * <p><b>Possible values:</b> |
| 2790 | * <ul> |
| 2791 | * <li>{@link #LENS_STATE_STATIONARY STATIONARY}</li> |
| 2792 | * <li>{@link #LENS_STATE_MOVING MOVING}</li> |
| 2793 | * </ul></p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2794 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2795 | * <p><b>Limited capability</b> - |
| 2796 | * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the |
| 2797 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 2798 | * |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2799 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 2800 | * @see CaptureRequest#LENS_APERTURE |
| 2801 | * @see CaptureRequest#LENS_FILTER_DENSITY |
| 2802 | * @see CaptureRequest#LENS_FOCAL_LENGTH |
| 2803 | * @see CaptureRequest#LENS_FOCUS_DISTANCE |
| 2804 | * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES |
| 2805 | * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES |
| 2806 | * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS |
| 2807 | * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2808 | * @see #LENS_STATE_STATIONARY |
Igor Murashkin | 9ea4ae6 | 2013-09-11 21:40:11 -0700 | [diff] [blame] | 2809 | * @see #LENS_STATE_MOVING |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2810 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2811 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2812 | public static final Key<Integer> LENS_STATE = |
| 2813 | new Key<Integer>("android.lens.state", int.class); |
| 2814 | |
| 2815 | /** |
Eino-Ville Talvala | 046a978 | 2015-04-08 20:05:56 +0000 | [diff] [blame] | 2816 | * <p>The orientation of the camera relative to the sensor |
| 2817 | * coordinate system.</p> |
Eino-Ville Talvala | abf0b8b | 2015-08-19 16:21:15 -0700 | [diff] [blame] | 2818 | * <p>The four coefficients that describe the quaternion |
Eino-Ville Talvala | 046a978 | 2015-04-08 20:05:56 +0000 | [diff] [blame] | 2819 | * rotation from the Android sensor coordinate system to a |
| 2820 | * camera-aligned coordinate system where the X-axis is |
| 2821 | * aligned with the long side of the image sensor, the Y-axis |
| 2822 | * is aligned with the short side of the image sensor, and |
| 2823 | * the Z-axis is aligned with the optical axis of the sensor.</p> |
Eino-Ville Talvala | abf0b8b | 2015-08-19 16:21:15 -0700 | [diff] [blame] | 2824 | * <p>To convert from the quaternion coefficients <code>(x,y,z,w)</code> |
Eino-Ville Talvala | 046a978 | 2015-04-08 20:05:56 +0000 | [diff] [blame] | 2825 | * to the axis of rotation <code>(a_x, a_y, a_z)</code> and rotation |
| 2826 | * amount <code>theta</code>, the following formulas can be used:</p> |
| 2827 | * <pre><code> theta = 2 * acos(w) |
| 2828 | * a_x = x / sin(theta/2) |
| 2829 | * a_y = y / sin(theta/2) |
| 2830 | * a_z = z / sin(theta/2) |
| 2831 | * </code></pre> |
| 2832 | * <p>To create a 3x3 rotation matrix that applies the rotation |
Eino-Ville Talvala | abf0b8b | 2015-08-19 16:21:15 -0700 | [diff] [blame] | 2833 | * defined by this quaternion, the following matrix can be |
Eino-Ville Talvala | 046a978 | 2015-04-08 20:05:56 +0000 | [diff] [blame] | 2834 | * used:</p> |
| 2835 | * <pre><code>R = [ 1 - 2y^2 - 2z^2, 2xy - 2zw, 2xz + 2yw, |
| 2836 | * 2xy + 2zw, 1 - 2x^2 - 2z^2, 2yz - 2xw, |
| 2837 | * 2xz - 2yw, 2yz + 2xw, 1 - 2x^2 - 2y^2 ] |
| 2838 | * </code></pre> |
| 2839 | * <p>This matrix can then be used to apply the rotation to a |
| 2840 | * column vector point with</p> |
| 2841 | * <p><code>p' = Rp</code></p> |
| 2842 | * <p>where <code>p</code> is in the device sensor coordinate system, and |
| 2843 | * <code>p'</code> is in the camera-oriented coordinate system.</p> |
| 2844 | * <p><b>Units</b>: |
Eino-Ville Talvala | abf0b8b | 2015-08-19 16:21:15 -0700 | [diff] [blame] | 2845 | * Quaternion coefficients</p> |
Eino-Ville Talvala | 046a978 | 2015-04-08 20:05:56 +0000 | [diff] [blame] | 2846 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2847 | */ |
| 2848 | @PublicKey |
| 2849 | public static final Key<float[]> LENS_POSE_ROTATION = |
| 2850 | new Key<float[]>("android.lens.poseRotation", float[].class); |
| 2851 | |
| 2852 | /** |
| 2853 | * <p>Position of the camera optical center.</p> |
Eino-Ville Talvala | d3dbfb3 | 2015-05-29 17:17:04 -0700 | [diff] [blame] | 2854 | * <p>The position of the camera device's lens optical center, |
Eino-Ville Talvala | ec99efa | 2017-11-29 15:35:42 -0800 | [diff] [blame] | 2855 | * as a three-dimensional vector <code>(x,y,z)</code>.</p> |
| 2856 | * <p>Prior to Android P, or when {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} is PRIMARY_CAMERA, this position |
| 2857 | * is relative to the optical center of the largest camera device facing in the same |
| 2858 | * direction as this camera, in the {@link android.hardware.SensorEvent Android sensor |
| 2859 | * coordinate axes}. Note that only the axis definitions are shared with the sensor |
| 2860 | * coordinate system, but not the origin.</p> |
| 2861 | * <p>If this device is the largest or only camera device with a given facing, then this |
| 2862 | * position will be <code>(0, 0, 0)</code>; a camera device with a lens optical center located 3 cm |
| 2863 | * from the main sensor along the +X axis (to the right from the user's perspective) will |
Eino-Ville Talvala | 08bd163 | 2018-08-01 17:23:09 -0700 | [diff] [blame] | 2864 | * report <code>(0.03, 0, 0)</code>. Note that this means that, for many computer vision |
| 2865 | * applications, the position needs to be negated to convert it to a translation from the |
| 2866 | * camera to the origin.</p> |
Eino-Ville Talvala | ec99efa | 2017-11-29 15:35:42 -0800 | [diff] [blame] | 2867 | * <p>To transform a pixel coordinates between two cameras facing the same direction, first |
Eino-Ville Talvala | 915f504 | 2018-03-13 19:08:01 -0700 | [diff] [blame] | 2868 | * the source camera {@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion} must be corrected for. Then the source |
Eino-Ville Talvala | ec99efa | 2017-11-29 15:35:42 -0800 | [diff] [blame] | 2869 | * camera {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} needs to be applied, followed by the |
| 2870 | * {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} of the source camera, the translation of the source camera |
| 2871 | * relative to the destination camera, the {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} of the destination |
| 2872 | * camera, and finally the inverse of {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} of the destination |
| 2873 | * camera. This obtains a radial-distortion-free coordinate in the destination camera pixel |
| 2874 | * coordinates.</p> |
| 2875 | * <p>To compare this against a real image from the destination camera, the destination camera |
| 2876 | * image then needs to be corrected for radial distortion before comparison or sampling.</p> |
| 2877 | * <p>When {@link CameraCharacteristics#LENS_POSE_REFERENCE android.lens.poseReference} is GYROSCOPE, then this position is relative to |
Eino-Ville Talvala | 08bd163 | 2018-08-01 17:23:09 -0700 | [diff] [blame] | 2878 | * the center of the primary gyroscope on the device. The axis definitions are the same as |
| 2879 | * with PRIMARY_CAMERA.</p> |
Eino-Ville Talvala | 046a978 | 2015-04-08 20:05:56 +0000 | [diff] [blame] | 2880 | * <p><b>Units</b>: Meters</p> |
| 2881 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2882 | * |
Eino-Ville Talvala | 915f504 | 2018-03-13 19:08:01 -0700 | [diff] [blame] | 2883 | * @see CameraCharacteristics#LENS_DISTORTION |
Eino-Ville Talvala | abf0b8b | 2015-08-19 16:21:15 -0700 | [diff] [blame] | 2884 | * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION |
Eino-Ville Talvala | ec99efa | 2017-11-29 15:35:42 -0800 | [diff] [blame] | 2885 | * @see CameraCharacteristics#LENS_POSE_REFERENCE |
Eino-Ville Talvala | 046a978 | 2015-04-08 20:05:56 +0000 | [diff] [blame] | 2886 | * @see CameraCharacteristics#LENS_POSE_ROTATION |
| 2887 | */ |
| 2888 | @PublicKey |
| 2889 | public static final Key<float[]> LENS_POSE_TRANSLATION = |
| 2890 | new Key<float[]>("android.lens.poseTranslation", float[].class); |
| 2891 | |
| 2892 | /** |
| 2893 | * <p>The parameters for this camera device's intrinsic |
| 2894 | * calibration.</p> |
| 2895 | * <p>The five calibration parameters that describe the |
| 2896 | * transform from camera-centric 3D coordinates to sensor |
| 2897 | * pixel coordinates:</p> |
| 2898 | * <pre><code>[f_x, f_y, c_x, c_y, s] |
| 2899 | * </code></pre> |
| 2900 | * <p>Where <code>f_x</code> and <code>f_y</code> are the horizontal and vertical |
| 2901 | * focal lengths, <code>[c_x, c_y]</code> is the position of the optical |
| 2902 | * axis, and <code>s</code> is a skew parameter for the sensor plane not |
| 2903 | * being aligned with the lens plane.</p> |
| 2904 | * <p>These are typically used within a transformation matrix K:</p> |
| 2905 | * <pre><code>K = [ f_x, s, c_x, |
| 2906 | * 0, f_y, c_y, |
| 2907 | * 0 0, 1 ] |
| 2908 | * </code></pre> |
| 2909 | * <p>which can then be combined with the camera pose rotation |
| 2910 | * <code>R</code> and translation <code>t</code> ({@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} and |
Eino-Ville Talvala | 08bd163 | 2018-08-01 17:23:09 -0700 | [diff] [blame] | 2911 | * {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation}, respectively) to calculate the |
Eino-Ville Talvala | 046a978 | 2015-04-08 20:05:56 +0000 | [diff] [blame] | 2912 | * complete transform from world coordinates to pixel |
| 2913 | * coordinates:</p> |
Eino-Ville Talvala | 08bd163 | 2018-08-01 17:23:09 -0700 | [diff] [blame] | 2914 | * <pre><code>P = [ K 0 * [ R -Rt |
| 2915 | * 0 1 ] 0 1 ] |
Eino-Ville Talvala | 046a978 | 2015-04-08 20:05:56 +0000 | [diff] [blame] | 2916 | * </code></pre> |
Eino-Ville Talvala | 08bd163 | 2018-08-01 17:23:09 -0700 | [diff] [blame] | 2917 | * <p>(Note the negation of poseTranslation when mapping from camera |
| 2918 | * to world coordinates, and multiplication by the rotation).</p> |
| 2919 | * <p>With <code>p_w</code> being a point in the world coordinate system |
Eino-Ville Talvala | 046a978 | 2015-04-08 20:05:56 +0000 | [diff] [blame] | 2920 | * and <code>p_s</code> being a point in the camera active pixel array |
| 2921 | * coordinate system, and with the mapping including the |
| 2922 | * homogeneous division by z:</p> |
| 2923 | * <pre><code> p_h = (x_h, y_h, z_h) = P p_w |
| 2924 | * p_s = p_h / z_h |
| 2925 | * </code></pre> |
| 2926 | * <p>so <code>[x_s, y_s]</code> is the pixel coordinates of the world |
| 2927 | * point, <code>z_s = 1</code>, and <code>w_s</code> is a measurement of disparity |
| 2928 | * (depth) in pixel coordinates.</p> |
Eino-Ville Talvala | b8bd8ab | 2015-06-16 11:44:10 -0700 | [diff] [blame] | 2929 | * <p>Note that the coordinate system for this transform is the |
| 2930 | * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} system, |
| 2931 | * where <code>(0,0)</code> is the top-left of the |
| 2932 | * preCorrectionActiveArraySize rectangle. Once the pose and |
| 2933 | * intrinsic calibration transforms have been applied to a |
Eino-Ville Talvala | 915f504 | 2018-03-13 19:08:01 -0700 | [diff] [blame] | 2934 | * world point, then the {@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion} |
Eino-Ville Talvala | b8bd8ab | 2015-06-16 11:44:10 -0700 | [diff] [blame] | 2935 | * transform needs to be applied, and the result adjusted to |
| 2936 | * be in the {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} coordinate |
| 2937 | * system (where <code>(0, 0)</code> is the top-left of the |
| 2938 | * activeArraySize rectangle), to determine the final pixel |
| 2939 | * coordinate of the world point for processed (non-RAW) |
| 2940 | * output buffers.</p> |
Eino-Ville Talvala | 08bd163 | 2018-08-01 17:23:09 -0700 | [diff] [blame] | 2941 | * <p>For camera devices, the center of pixel <code>(x,y)</code> is located at |
| 2942 | * coordinate <code>(x + 0.5, y + 0.5)</code>. So on a device with a |
| 2943 | * precorrection active array of size <code>(10,10)</code>, the valid pixel |
| 2944 | * indices go from <code>(0,0)-(9,9)</code>, and an perfectly-built camera would |
| 2945 | * have an optical center at the exact center of the pixel grid, at |
| 2946 | * coordinates <code>(5.0, 5.0)</code>, which is the top-left corner of pixel |
| 2947 | * <code>(5,5)</code>.</p> |
Eino-Ville Talvala | 046a978 | 2015-04-08 20:05:56 +0000 | [diff] [blame] | 2948 | * <p><b>Units</b>: |
Eino-Ville Talvala | b8bd8ab | 2015-06-16 11:44:10 -0700 | [diff] [blame] | 2949 | * Pixels in the |
| 2950 | * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} |
| 2951 | * coordinate system.</p> |
Eino-Ville Talvala | 046a978 | 2015-04-08 20:05:56 +0000 | [diff] [blame] | 2952 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2953 | * |
Eino-Ville Talvala | 915f504 | 2018-03-13 19:08:01 -0700 | [diff] [blame] | 2954 | * @see CameraCharacteristics#LENS_DISTORTION |
Eino-Ville Talvala | 046a978 | 2015-04-08 20:05:56 +0000 | [diff] [blame] | 2955 | * @see CameraCharacteristics#LENS_POSE_ROTATION |
| 2956 | * @see CameraCharacteristics#LENS_POSE_TRANSLATION |
Eino-Ville Talvala | 0b7b03b | 2015-04-13 17:29:52 -0700 | [diff] [blame] | 2957 | * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE |
Eino-Ville Talvala | b8bd8ab | 2015-06-16 11:44:10 -0700 | [diff] [blame] | 2958 | * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE |
Eino-Ville Talvala | 046a978 | 2015-04-08 20:05:56 +0000 | [diff] [blame] | 2959 | */ |
| 2960 | @PublicKey |
| 2961 | public static final Key<float[]> LENS_INTRINSIC_CALIBRATION = |
| 2962 | new Key<float[]>("android.lens.intrinsicCalibration", float[].class); |
| 2963 | |
| 2964 | /** |
| 2965 | * <p>The correction coefficients to correct for this camera device's |
Eino-Ville Talvala | 66c73ba | 2015-05-29 16:11:56 -0700 | [diff] [blame] | 2966 | * radial and tangential lens distortion.</p> |
Ruben Brunk | 02cd8cb | 2015-06-15 15:33:09 -0700 | [diff] [blame] | 2967 | * <p>Four radial distortion coefficients <code>[kappa_0, kappa_1, kappa_2, |
Eino-Ville Talvala | 66c73ba | 2015-05-29 16:11:56 -0700 | [diff] [blame] | 2968 | * kappa_3]</code> and two tangential distortion coefficients |
| 2969 | * <code>[kappa_4, kappa_5]</code> that can be used to correct the |
| 2970 | * lens's geometric distortion with the mapping equations:</p> |
Ruben Brunk | 02cd8cb | 2015-06-15 15:33:09 -0700 | [diff] [blame] | 2971 | * <pre><code> x_c = x_i * ( kappa_0 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) + |
Eino-Ville Talvala | 66c73ba | 2015-05-29 16:11:56 -0700 | [diff] [blame] | 2972 | * kappa_4 * (2 * x_i * y_i) + kappa_5 * ( r^2 + 2 * x_i^2 ) |
Ruben Brunk | 02cd8cb | 2015-06-15 15:33:09 -0700 | [diff] [blame] | 2973 | * y_c = y_i * ( kappa_0 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) + |
Eino-Ville Talvala | 66c73ba | 2015-05-29 16:11:56 -0700 | [diff] [blame] | 2974 | * kappa_5 * (2 * x_i * y_i) + kappa_4 * ( r^2 + 2 * y_i^2 ) |
Eino-Ville Talvala | 046a978 | 2015-04-08 20:05:56 +0000 | [diff] [blame] | 2975 | * </code></pre> |
Eino-Ville Talvala | 66c73ba | 2015-05-29 16:11:56 -0700 | [diff] [blame] | 2976 | * <p>Here, <code>[x_c, y_c]</code> are the coordinates to sample in the |
| 2977 | * input image that correspond to the pixel values in the |
| 2978 | * corrected image at the coordinate <code>[x_i, y_i]</code>:</p> |
| 2979 | * <pre><code> correctedImage(x_i, y_i) = sample_at(x_c, y_c, inputImage) |
| 2980 | * </code></pre> |
| 2981 | * <p>The pixel coordinates are defined in a normalized |
| 2982 | * coordinate system related to the |
Eino-Ville Talvala | abf0b8b | 2015-08-19 16:21:15 -0700 | [diff] [blame] | 2983 | * {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} calibration fields. |
Eino-Ville Talvala | 66c73ba | 2015-05-29 16:11:56 -0700 | [diff] [blame] | 2984 | * Both <code>[x_i, y_i]</code> and <code>[x_c, y_c]</code> have <code>(0,0)</code> at the |
| 2985 | * lens optical center <code>[c_x, c_y]</code>. The maximum magnitudes |
| 2986 | * of both x and y coordinates are normalized to be 1 at the |
| 2987 | * edge further from the optical center, so the range |
| 2988 | * for both dimensions is <code>-1 <= x <= 1</code>.</p> |
| 2989 | * <p>Finally, <code>r</code> represents the radial distance from the |
| 2990 | * optical center, <code>r^2 = x_i^2 + y_i^2</code>, and its magnitude |
| 2991 | * is therefore no larger than <code>|r| <= sqrt(2)</code>.</p> |
| 2992 | * <p>The distortion model used is the Brown-Conrady model.</p> |
Eino-Ville Talvala | 046a978 | 2015-04-08 20:05:56 +0000 | [diff] [blame] | 2993 | * <p><b>Units</b>: |
Eino-Ville Talvala | 66c73ba | 2015-05-29 16:11:56 -0700 | [diff] [blame] | 2994 | * Unitless coefficients.</p> |
Eino-Ville Talvala | 046a978 | 2015-04-08 20:05:56 +0000 | [diff] [blame] | 2995 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
Eino-Ville Talvala | abf0b8b | 2015-08-19 16:21:15 -0700 | [diff] [blame] | 2996 | * |
| 2997 | * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION |
Eino-Ville Talvala | 915f504 | 2018-03-13 19:08:01 -0700 | [diff] [blame] | 2998 | * @deprecated |
| 2999 | * <p>This field was inconsistently defined in terms of its |
| 3000 | * normalization. Use {@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion} instead.</p> |
| 3001 | * |
| 3002 | * @see CameraCharacteristics#LENS_DISTORTION |
| 3003 | |
Eino-Ville Talvala | 046a978 | 2015-04-08 20:05:56 +0000 | [diff] [blame] | 3004 | */ |
Eino-Ville Talvala | 915f504 | 2018-03-13 19:08:01 -0700 | [diff] [blame] | 3005 | @Deprecated |
Eino-Ville Talvala | 046a978 | 2015-04-08 20:05:56 +0000 | [diff] [blame] | 3006 | @PublicKey |
| 3007 | public static final Key<float[]> LENS_RADIAL_DISTORTION = |
| 3008 | new Key<float[]>("android.lens.radialDistortion", float[].class); |
| 3009 | |
| 3010 | /** |
Eino-Ville Talvala | 915f504 | 2018-03-13 19:08:01 -0700 | [diff] [blame] | 3011 | * <p>The correction coefficients to correct for this camera device's |
| 3012 | * radial and tangential lens distortion.</p> |
| 3013 | * <p>Replaces the deprecated {@link CameraCharacteristics#LENS_RADIAL_DISTORTION android.lens.radialDistortion} field, which was |
| 3014 | * inconsistently defined.</p> |
| 3015 | * <p>Three radial distortion coefficients <code>[kappa_1, kappa_2, |
| 3016 | * kappa_3]</code> and two tangential distortion coefficients |
| 3017 | * <code>[kappa_4, kappa_5]</code> that can be used to correct the |
| 3018 | * lens's geometric distortion with the mapping equations:</p> |
| 3019 | * <pre><code> x_c = x_i * ( 1 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) + |
| 3020 | * kappa_4 * (2 * x_i * y_i) + kappa_5 * ( r^2 + 2 * x_i^2 ) |
| 3021 | * y_c = y_i * ( 1 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) + |
| 3022 | * kappa_5 * (2 * x_i * y_i) + kappa_4 * ( r^2 + 2 * y_i^2 ) |
| 3023 | * </code></pre> |
| 3024 | * <p>Here, <code>[x_c, y_c]</code> are the coordinates to sample in the |
| 3025 | * input image that correspond to the pixel values in the |
| 3026 | * corrected image at the coordinate <code>[x_i, y_i]</code>:</p> |
| 3027 | * <pre><code> correctedImage(x_i, y_i) = sample_at(x_c, y_c, inputImage) |
| 3028 | * </code></pre> |
| 3029 | * <p>The pixel coordinates are defined in a coordinate system |
| 3030 | * related to the {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} |
| 3031 | * calibration fields; see that entry for details of the mapping stages. |
| 3032 | * Both <code>[x_i, y_i]</code> and <code>[x_c, y_c]</code> |
| 3033 | * have <code>(0,0)</code> at the lens optical center <code>[c_x, c_y]</code>, and |
| 3034 | * the range of the coordinates depends on the focal length |
| 3035 | * terms of the intrinsic calibration.</p> |
| 3036 | * <p>Finally, <code>r</code> represents the radial distance from the |
| 3037 | * optical center, <code>r^2 = x_i^2 + y_i^2</code>.</p> |
| 3038 | * <p>The distortion model used is the Brown-Conrady model.</p> |
| 3039 | * <p><b>Units</b>: |
| 3040 | * Unitless coefficients.</p> |
| 3041 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 3042 | * |
| 3043 | * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION |
| 3044 | * @see CameraCharacteristics#LENS_RADIAL_DISTORTION |
| 3045 | */ |
| 3046 | @PublicKey |
| 3047 | public static final Key<float[]> LENS_DISTORTION = |
| 3048 | new Key<float[]>("android.lens.distortion", float[].class); |
| 3049 | |
| 3050 | /** |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 3051 | * <p>Mode of operation for the noise reduction algorithm.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3052 | * <p>The noise reduction algorithm attempts to improve image quality by removing |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 3053 | * excessive noise added by the capture process, especially in dark conditions.</p> |
| 3054 | * <p>OFF means no noise reduction will be applied by the camera device, for both raw and |
| 3055 | * YUV domain.</p> |
| 3056 | * <p>MINIMAL means that only sensor raw domain basic noise reduction is enabled ,to remove |
| 3057 | * demosaicing or other processing artifacts. For YUV_REPROCESSING, MINIMAL is same as OFF. |
| 3058 | * This mode is optional, may not be support by all devices. The application should check |
| 3059 | * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes} before using it.</p> |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 3060 | * <p>FAST/HIGH_QUALITY both mean camera device determined noise filtering |
| 3061 | * will be applied. HIGH_QUALITY mode indicates that the camera device |
| 3062 | * will use the highest-quality noise filtering algorithms, |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 3063 | * even if it slows down capture rate. FAST means the camera device will not |
Chien-Yu Chen | 9c9167e | 2015-07-14 16:38:25 -0700 | [diff] [blame] | 3064 | * slow down capture rate when applying noise filtering. FAST may be the same as MINIMAL if |
| 3065 | * MINIMAL is listed, or the same as OFF if any noise filtering will slow down capture rate. |
| 3066 | * Every output stream will have a similar amount of enhancement applied.</p> |
Eino-Ville Talvala | 0dd1750 | 2015-07-07 10:43:07 -0700 | [diff] [blame] | 3067 | * <p>ZERO_SHUTTER_LAG is meant to be used by applications that maintain a continuous circular |
| 3068 | * buffer of high-resolution images during preview and reprocess image(s) from that buffer |
| 3069 | * into a final capture when triggered by the user. In this mode, the camera device applies |
| 3070 | * noise reduction to low-resolution streams (below maximum recording resolution) to maximize |
| 3071 | * preview quality, but does not apply noise reduction to high-resolution streams, since |
| 3072 | * those will be reprocessed later if necessary.</p> |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 3073 | * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera device |
| 3074 | * will apply FAST/HIGH_QUALITY YUV domain noise reduction, respectively. The camera device |
| 3075 | * may adjust the noise reduction parameters for best image quality based on the |
| 3076 | * {@link CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR android.reprocess.effectiveExposureFactor} if it is set.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3077 | * <p><b>Possible values:</b> |
| 3078 | * <ul> |
| 3079 | * <li>{@link #NOISE_REDUCTION_MODE_OFF OFF}</li> |
| 3080 | * <li>{@link #NOISE_REDUCTION_MODE_FAST FAST}</li> |
| 3081 | * <li>{@link #NOISE_REDUCTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li> |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 3082 | * <li>{@link #NOISE_REDUCTION_MODE_MINIMAL MINIMAL}</li> |
Eino-Ville Talvala | 0dd1750 | 2015-07-07 10:43:07 -0700 | [diff] [blame] | 3083 | * <li>{@link #NOISE_REDUCTION_MODE_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3084 | * </ul></p> |
| 3085 | * <p><b>Available values for this device:</b><br> |
| 3086 | * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3087 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 3088 | * <p><b>Full capability</b> - |
| 3089 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 3090 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Ruben Brunk | 6dc379c | 2014-03-04 15:04:00 -0800 | [diff] [blame] | 3091 | * |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3092 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Ruben Brunk | 6dc379c | 2014-03-04 15:04:00 -0800 | [diff] [blame] | 3093 | * @see CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 3094 | * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3095 | * @see #NOISE_REDUCTION_MODE_OFF |
| 3096 | * @see #NOISE_REDUCTION_MODE_FAST |
| 3097 | * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 3098 | * @see #NOISE_REDUCTION_MODE_MINIMAL |
Eino-Ville Talvala | 0dd1750 | 2015-07-07 10:43:07 -0700 | [diff] [blame] | 3099 | * @see #NOISE_REDUCTION_MODE_ZERO_SHUTTER_LAG |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3100 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 3101 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3102 | public static final Key<Integer> NOISE_REDUCTION_MODE = |
| 3103 | new Key<Integer>("android.noiseReduction.mode", int.class); |
| 3104 | |
| 3105 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3106 | * <p>Whether a result given to the framework is the |
Eino-Ville Talvala | 7a31310 | 2013-11-07 14:45:06 -0800 | [diff] [blame] | 3107 | * final one for the capture, or only a partial that contains a |
| 3108 | * subset of the full set of dynamic metadata |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3109 | * values.</p> |
| 3110 | * <p>The entries in the result metadata buffers for a |
Eino-Ville Talvala | 7a31310 | 2013-11-07 14:45:06 -0800 | [diff] [blame] | 3111 | * single capture may not overlap, except for this entry. The |
| 3112 | * FINAL buffers must retain FIFO ordering relative to the |
| 3113 | * requests that generate them, so the FINAL buffer for frame 3 must |
| 3114 | * always be sent to the framework after the FINAL buffer for frame 2, and |
| 3115 | * before the FINAL buffer for frame 4. PARTIAL buffers may be returned |
| 3116 | * in any order relative to other frames, but all PARTIAL buffers for a given |
| 3117 | * capture must arrive before the FINAL buffer for that capture. This entry may |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 3118 | * only be used by the camera device if quirks.usePartialResult is set to 1.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3119 | * <p><b>Range of valid values:</b><br> |
| 3120 | * Optional. Default value is FINAL.</p> |
Igor Murashkin | 3242f4f | 2014-01-15 12:27:41 -0800 | [diff] [blame] | 3121 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
Igor Murashkin | 9c59517 | 2014-05-12 13:56:20 -0700 | [diff] [blame] | 3122 | * @deprecated |
Eino-Ville Talvala | 915f504 | 2018-03-13 19:08:01 -0700 | [diff] [blame] | 3123 | * <p>Not used in HALv3 or newer</p> |
| 3124 | |
Eino-Ville Talvala | 7a31310 | 2013-11-07 14:45:06 -0800 | [diff] [blame] | 3125 | * @hide |
| 3126 | */ |
Igor Murashkin | 9c59517 | 2014-05-12 13:56:20 -0700 | [diff] [blame] | 3127 | @Deprecated |
Mathew Inwood | bcbe440 | 2018-08-08 15:42:59 +0100 | [diff] [blame^] | 3128 | @UnsupportedAppUsage |
Eino-Ville Talvala | 7a31310 | 2013-11-07 14:45:06 -0800 | [diff] [blame] | 3129 | public static final Key<Boolean> QUIRKS_PARTIAL_RESULT = |
| 3130 | new Key<Boolean>("android.quirks.partialResult", boolean.class); |
| 3131 | |
| 3132 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3133 | * <p>A frame counter set by the framework. This value monotonically |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 3134 | * increases with every new result (that is, each new result has a unique |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3135 | * frameCount value).</p> |
| 3136 | * <p>Reset on release()</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3137 | * <p><b>Units</b>: count of frames</p> |
| 3138 | * <p><b>Range of valid values:</b><br> |
| 3139 | * > 0</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3140 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
Igor Murashkin | bdf366c | 2014-07-25 16:54:20 -0700 | [diff] [blame] | 3141 | * @deprecated |
Eino-Ville Talvala | 915f504 | 2018-03-13 19:08:01 -0700 | [diff] [blame] | 3142 | * <p>Not used in HALv3 or newer</p> |
| 3143 | |
Igor Murashkin | bdf366c | 2014-07-25 16:54:20 -0700 | [diff] [blame] | 3144 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3145 | */ |
Igor Murashkin | bdf366c | 2014-07-25 16:54:20 -0700 | [diff] [blame] | 3146 | @Deprecated |
Mathew Inwood | bcbe440 | 2018-08-08 15:42:59 +0100 | [diff] [blame^] | 3147 | @UnsupportedAppUsage |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3148 | public static final Key<Integer> REQUEST_FRAME_COUNT = |
| 3149 | new Key<Integer>("android.request.frameCount", int.class); |
| 3150 | |
| 3151 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3152 | * <p>An application-specified ID for the current |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3153 | * request. Must be maintained unchanged in output |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3154 | * frame</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3155 | * <p><b>Units</b>: arbitrary integer assigned by application</p> |
| 3156 | * <p><b>Range of valid values:</b><br> |
| 3157 | * Any int</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3158 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3159 | * @hide |
| 3160 | */ |
Mathew Inwood | bcbe440 | 2018-08-08 15:42:59 +0100 | [diff] [blame^] | 3161 | @UnsupportedAppUsage |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3162 | public static final Key<Integer> REQUEST_ID = |
| 3163 | new Key<Integer>("android.request.id", int.class); |
| 3164 | |
| 3165 | /** |
Igor Murashkin | c127f05 | 2014-01-17 18:06:02 -0800 | [diff] [blame] | 3166 | * <p>Specifies the number of pipeline stages the frame went |
| 3167 | * through from when it was exposed to when the final completed result |
| 3168 | * was available to the framework.</p> |
| 3169 | * <p>Depending on what settings are used in the request, and |
| 3170 | * what streams are configured, the data may undergo less processing, |
| 3171 | * and some pipeline stages skipped.</p> |
| 3172 | * <p>See {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} for more details.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3173 | * <p><b>Range of valid values:</b><br> |
| 3174 | * <= {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3175 | * <p>This key is available on all devices.</p> |
Igor Murashkin | c127f05 | 2014-01-17 18:06:02 -0800 | [diff] [blame] | 3176 | * |
| 3177 | * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH |
| 3178 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 3179 | @PublicKey |
Igor Murashkin | c127f05 | 2014-01-17 18:06:02 -0800 | [diff] [blame] | 3180 | public static final Key<Byte> REQUEST_PIPELINE_DEPTH = |
| 3181 | new Key<Byte>("android.request.pipelineDepth", byte.class); |
| 3182 | |
| 3183 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3184 | * <p>The desired region of the sensor to read out for this capture.</p> |
| 3185 | * <p>This control can be used to implement digital zoom.</p> |
Yin-Chia Yeh | 6c73e40 | 2018-06-15 15:37:08 -0700 | [diff] [blame] | 3186 | * <p>For devices not supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate |
| 3187 | * system always follows that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being |
| 3188 | * the top-left pixel of the active array.</p> |
| 3189 | * <p>For devices supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate |
| 3190 | * system depends on the mode being set. |
| 3191 | * When the distortion correction mode is OFF, the coordinate system follows |
| 3192 | * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, with |
| 3193 | * <code>(0, 0)</code> being the top-left pixel of the pre-correction active array. |
| 3194 | * When the distortion correction mode is not OFF, the coordinate system follows |
| 3195 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with |
| 3196 | * <code>(0, 0)</code> being the top-left pixel of the active array.</p> |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 3197 | * <p>Output streams use this rectangle to produce their output, |
| 3198 | * cropping to a smaller region if necessary to maintain the |
| 3199 | * stream's aspect ratio, then scaling the sensor input to |
| 3200 | * match the output's configured resolution.</p> |
| 3201 | * <p>The crop region is applied after the RAW to other color |
| 3202 | * space (e.g. YUV) conversion. Since raw streams |
| 3203 | * (e.g. RAW16) don't have the conversion stage, they are not |
| 3204 | * croppable. The crop region will be ignored by raw streams.</p> |
Zhijun He | 9e6d188 | 2014-05-22 16:47:35 -0700 | [diff] [blame] | 3205 | * <p>For non-raw streams, any additional per-stream cropping will |
| 3206 | * be done to maximize the final pixel area of the stream.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3207 | * <p>For example, if the crop region is set to a 4:3 aspect |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 3208 | * ratio, then 4:3 streams will use the exact crop |
| 3209 | * region. 16:9 streams will further crop vertically |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3210 | * (letterbox).</p> |
| 3211 | * <p>Conversely, if the crop region is set to a 16:9, then 4:3 |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 3212 | * outputs will crop horizontally (pillarbox), and 16:9 |
| 3213 | * streams will match exactly. These additional crops will |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3214 | * be centered within the crop region.</p> |
Eino-Ville Talvala | 08bd163 | 2018-08-01 17:23:09 -0700 | [diff] [blame] | 3215 | * <p>If the coordinate system is {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, the width and height |
Yin-Chia Yeh | 6c73e40 | 2018-06-15 15:37:08 -0700 | [diff] [blame] | 3216 | * of the crop region cannot be set to be smaller than |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 3217 | * <code>floor( activeArraySize.width / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code> and |
| 3218 | * <code>floor( activeArraySize.height / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code>, respectively.</p> |
Yin-Chia Yeh | 6c73e40 | 2018-06-15 15:37:08 -0700 | [diff] [blame] | 3219 | * <p>If the coordinate system is {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, the width |
| 3220 | * and height of the crop region cannot be set to be smaller than |
| 3221 | * <code>floor( preCorrectionActiveArraySize.width / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code> |
| 3222 | * and |
| 3223 | * <code>floor( preCorrectionActiveArraySize.height / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code>, |
| 3224 | * respectively.</p> |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 3225 | * <p>The camera device may adjust the crop region to account |
| 3226 | * for rounding and other hardware requirements; the final |
| 3227 | * crop region used will be included in the output capture |
| 3228 | * result.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3229 | * <p><b>Units</b>: Pixel coordinates relative to |
Yin-Chia Yeh | 6c73e40 | 2018-06-15 15:37:08 -0700 | [diff] [blame] | 3230 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} or |
| 3231 | * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} depending on distortion correction |
| 3232 | * capability and mode</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3233 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | d8fd679 | 2014-02-10 12:41:04 -0800 | [diff] [blame] | 3234 | * |
Yin-Chia Yeh | 6c73e40 | 2018-06-15 15:37:08 -0700 | [diff] [blame] | 3235 | * @see CaptureRequest#DISTORTION_CORRECTION_MODE |
Eino-Ville Talvala | d8fd679 | 2014-02-10 12:41:04 -0800 | [diff] [blame] | 3236 | * @see CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 3237 | * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE |
Yin-Chia Yeh | 6c73e40 | 2018-06-15 15:37:08 -0700 | [diff] [blame] | 3238 | * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3239 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 3240 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3241 | public static final Key<android.graphics.Rect> SCALER_CROP_REGION = |
| 3242 | new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class); |
| 3243 | |
| 3244 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3245 | * <p>Duration each pixel is exposed to |
| 3246 | * light.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3247 | * <p>If the sensor can't expose this exact duration, it will shorten the |
| 3248 | * duration exposed to the nearest possible value (rather than expose longer). |
| 3249 | * The final exposure time used will be available in the output capture result.</p> |
| 3250 | * <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 |
| 3251 | * OFF; otherwise the auto-exposure algorithm will override this value.</p> |
| 3252 | * <p><b>Units</b>: Nanoseconds</p> |
| 3253 | * <p><b>Range of valid values:</b><br> |
| 3254 | * {@link CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE android.sensor.info.exposureTimeRange}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3255 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 3256 | * <p><b>Full capability</b> - |
| 3257 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 3258 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
| 3259 | * |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3260 | * @see CaptureRequest#CONTROL_AE_MODE |
| 3261 | * @see CaptureRequest#CONTROL_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3262 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3263 | * @see CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3264 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 3265 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3266 | public static final Key<Long> SENSOR_EXPOSURE_TIME = |
| 3267 | new Key<Long>("android.sensor.exposureTime", long.class); |
| 3268 | |
| 3269 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3270 | * <p>Duration from start of frame exposure to |
Igor Murashkin | 143aa0b | 2014-01-17 15:02:34 -0800 | [diff] [blame] | 3271 | * start of next frame exposure.</p> |
| 3272 | * <p>The maximum frame rate that can be supported by a camera subsystem is |
| 3273 | * a function of many factors:</p> |
| 3274 | * <ul> |
| 3275 | * <li>Requested resolutions of output image streams</li> |
| 3276 | * <li>Availability of binning / skipping modes on the imager</li> |
| 3277 | * <li>The bandwidth of the imager interface</li> |
| 3278 | * <li>The bandwidth of the various ISP processing blocks</li> |
| 3279 | * </ul> |
| 3280 | * <p>Since these factors can vary greatly between different ISPs and |
| 3281 | * sensors, the camera abstraction tries to represent the bandwidth |
| 3282 | * restrictions with as simple a model as possible.</p> |
| 3283 | * <p>The model presented has the following characteristics:</p> |
| 3284 | * <ul> |
| 3285 | * <li>The image sensor is always configured to output the smallest |
| 3286 | * resolution possible given the application's requested output stream |
| 3287 | * sizes. The smallest resolution is defined as being at least as large |
| 3288 | * as the largest requested output stream size; the camera pipeline must |
| 3289 | * never digitally upsample sensor data when the crop region covers the |
| 3290 | * whole sensor. In general, this means that if only small output stream |
| 3291 | * resolutions are configured, the sensor can provide a higher frame |
| 3292 | * rate.</li> |
| 3293 | * <li>Since any request may use any or all the currently configured |
| 3294 | * output streams, the sensor and ISP must be configured to support |
| 3295 | * scaling a single capture to all the streams at the same time. This |
| 3296 | * means the camera pipeline must be ready to produce the largest |
| 3297 | * requested output size without any delay. Therefore, the overall |
| 3298 | * frame rate of a given configured stream set is governed only by the |
| 3299 | * largest requested stream resolution.</li> |
| 3300 | * <li>Using more than one output stream in a request does not affect the |
| 3301 | * frame duration.</li> |
Igor Murashkin | a23ffb5 | 2014-02-07 18:52:34 -0800 | [diff] [blame] | 3302 | * <li>Certain format-streams may need to do additional background processing |
| 3303 | * before data is consumed/produced by that stream. These processors |
| 3304 | * can run concurrently to the rest of the camera pipeline, but |
| 3305 | * cannot process more than 1 capture at a time.</li> |
Igor Murashkin | 143aa0b | 2014-01-17 15:02:34 -0800 | [diff] [blame] | 3306 | * </ul> |
Eino-Ville Talvala | 9dc7ec1 | 2017-11-10 15:23:00 -0800 | [diff] [blame] | 3307 | * <p>The necessary information for the application, given the model above, is provided via |
Eino-Ville Talvala | b6eb52f | 2015-04-16 16:39:45 -0700 | [diff] [blame] | 3308 | * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration }. |
Eino-Ville Talvala | 9dc7ec1 | 2017-11-10 15:23:00 -0800 | [diff] [blame] | 3309 | * These are used to determine the maximum frame rate / minimum frame duration that is |
| 3310 | * possible for a given stream configuration.</p> |
Igor Murashkin | 143aa0b | 2014-01-17 15:02:34 -0800 | [diff] [blame] | 3311 | * <p>Specifically, the application can use the following rules to |
Igor Murashkin | a23ffb5 | 2014-02-07 18:52:34 -0800 | [diff] [blame] | 3312 | * determine the minimum frame duration it can request from the camera |
Igor Murashkin | 143aa0b | 2014-01-17 15:02:34 -0800 | [diff] [blame] | 3313 | * device:</p> |
| 3314 | * <ol> |
Eino-Ville Talvala | 9dc7ec1 | 2017-11-10 15:23:00 -0800 | [diff] [blame] | 3315 | * <li>Let the set of currently configured input/output streams be called <code>S</code>.</li> |
| 3316 | * <li>Find the minimum frame durations for each stream in <code>S</code>, by looking it up in {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration } |
| 3317 | * (with its respective size/format). Let this set of frame durations be called <code>F</code>.</li> |
| 3318 | * <li>For any given request <code>R</code>, the minimum frame duration allowed for <code>R</code> is the maximum |
| 3319 | * out of all values in <code>F</code>. Let the streams used in <code>R</code> be called <code>S_r</code>.</li> |
Igor Murashkin | 143aa0b | 2014-01-17 15:02:34 -0800 | [diff] [blame] | 3320 | * </ol> |
Eino-Ville Talvala | b6eb52f | 2015-04-16 16:39:45 -0700 | [diff] [blame] | 3321 | * <p>If none of the streams in <code>S_r</code> have a stall time (listed in {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration } |
Eino-Ville Talvala | 9dc7ec1 | 2017-11-10 15:23:00 -0800 | [diff] [blame] | 3322 | * using its respective size/format), then the frame duration in <code>F</code> determines the steady |
| 3323 | * state frame rate that the application will get if it uses <code>R</code> as a repeating request. Let |
| 3324 | * this special kind of request be called <code>Rsimple</code>.</p> |
| 3325 | * <p>A repeating request <code>Rsimple</code> can be <em>occasionally</em> interleaved by a single capture of a |
| 3326 | * new request <code>Rstall</code> (which has at least one in-use stream with a non-0 stall time) and if |
| 3327 | * <code>Rstall</code> has the same minimum frame duration this will not cause a frame rate loss if all |
| 3328 | * buffers from the previous <code>Rstall</code> have already been delivered.</p> |
| 3329 | * <p>For more details about stalling, see {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration }.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3330 | * <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 |
| 3331 | * OFF; otherwise the auto-exposure algorithm will override this value.</p> |
| 3332 | * <p><b>Units</b>: Nanoseconds</p> |
| 3333 | * <p><b>Range of valid values:</b><br> |
Eino-Ville Talvala | 9dc7ec1 | 2017-11-10 15:23:00 -0800 | [diff] [blame] | 3334 | * See {@link CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION android.sensor.info.maxFrameDuration}, {@link android.hardware.camera2.params.StreamConfigurationMap }. |
| 3335 | * The duration is capped to <code>max(duration, exposureTime + overhead)</code>.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3336 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 3337 | * <p><b>Full capability</b> - |
| 3338 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 3339 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Igor Murashkin | 143aa0b | 2014-01-17 15:02:34 -0800 | [diff] [blame] | 3340 | * |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3341 | * @see CaptureRequest#CONTROL_AE_MODE |
| 3342 | * @see CaptureRequest#CONTROL_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3343 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3344 | * @see CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3345 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 3346 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3347 | public static final Key<Long> SENSOR_FRAME_DURATION = |
| 3348 | new Key<Long>("android.sensor.frameDuration", long.class); |
| 3349 | |
| 3350 | /** |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 3351 | * <p>The amount of gain applied to sensor data |
| 3352 | * before processing.</p> |
| 3353 | * <p>The sensitivity is the standard ISO sensitivity value, |
| 3354 | * as defined in ISO 12232:2006.</p> |
| 3355 | * <p>The sensitivity must be within {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}, and |
| 3356 | * if if it less than {@link CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY android.sensor.maxAnalogSensitivity}, the camera device |
| 3357 | * is guaranteed to use only analog amplification for applying the gain.</p> |
| 3358 | * <p>If the camera device cannot apply the exact sensitivity |
| 3359 | * requested, it will reduce the gain to the nearest supported |
| 3360 | * value. The final sensitivity used will be available in the |
| 3361 | * output capture result.</p> |
Yin-Chia Yeh | 1ee1a0a | 2016-01-18 19:13:47 -0800 | [diff] [blame] | 3362 | * <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 |
| 3363 | * OFF; otherwise the auto-exposure algorithm will override this value.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3364 | * <p><b>Units</b>: ISO arithmetic units</p> |
| 3365 | * <p><b>Range of valid values:</b><br> |
| 3366 | * {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3367 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 3368 | * <p><b>Full capability</b> - |
| 3369 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 3370 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 3371 | * |
Yin-Chia Yeh | 1ee1a0a | 2016-01-18 19:13:47 -0800 | [diff] [blame] | 3372 | * @see CaptureRequest#CONTROL_AE_MODE |
| 3373 | * @see CaptureRequest#CONTROL_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3374 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 3375 | * @see CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE |
| 3376 | * @see CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3377 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 3378 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3379 | public static final Key<Integer> SENSOR_SENSITIVITY = |
| 3380 | new Key<Integer>("android.sensor.sensitivity", int.class); |
| 3381 | |
| 3382 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3383 | * <p>Time at start of exposure of first |
Zhijun He | 0bda31a | 2014-06-13 14:38:39 -0700 | [diff] [blame] | 3384 | * row of the image sensor active array, in nanoseconds.</p> |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 3385 | * <p>The timestamps are also included in all image |
| 3386 | * buffers produced for the same capture, and will be identical |
Zhijun He | 45fa43a1 | 2014-06-13 18:29:37 -0700 | [diff] [blame] | 3387 | * on all the outputs.</p> |
Eino-Ville Talvala | abd9d3c | 2014-07-28 13:01:52 -0700 | [diff] [blame] | 3388 | * <p>When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> UNKNOWN, |
Zhijun He | 45fa43a1 | 2014-06-13 18:29:37 -0700 | [diff] [blame] | 3389 | * the timestamps measure time since an unspecified starting point, |
| 3390 | * and are monotonically increasing. They can be compared with the |
| 3391 | * timestamps for other captures from the same camera device, but are |
| 3392 | * not guaranteed to be comparable to any other time source.</p> |
Eino-Ville Talvala | b6eb52f | 2015-04-16 16:39:45 -0700 | [diff] [blame] | 3393 | * <p>When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> REALTIME, the |
| 3394 | * timestamps measure time in the same timebase as {@link android.os.SystemClock#elapsedRealtimeNanos }, and they can |
| 3395 | * be compared to other timestamps from other subsystems that |
| 3396 | * are using that base.</p> |
Chien-Yu Chen | 6216e4e | 2015-05-29 11:49:54 -0700 | [diff] [blame] | 3397 | * <p>For reprocessing, the timestamp will match the start of exposure of |
| 3398 | * the input image, i.e. {@link CaptureResult#SENSOR_TIMESTAMP the |
| 3399 | * timestamp} in the TotalCaptureResult that was used to create the |
| 3400 | * reprocess capture request.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3401 | * <p><b>Units</b>: Nanoseconds</p> |
| 3402 | * <p><b>Range of valid values:</b><br> |
| 3403 | * > 0</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3404 | * <p>This key is available on all devices.</p> |
Zhijun He | 45fa43a1 | 2014-06-13 18:29:37 -0700 | [diff] [blame] | 3405 | * |
Eino-Ville Talvala | abd9d3c | 2014-07-28 13:01:52 -0700 | [diff] [blame] | 3406 | * @see CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3407 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 3408 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3409 | public static final Key<Long> SENSOR_TIMESTAMP = |
| 3410 | new Key<Long>("android.sensor.timestamp", long.class); |
| 3411 | |
| 3412 | /** |
Ruben Brunk | 7c06236 | 2014-04-15 23:53:53 -0700 | [diff] [blame] | 3413 | * <p>The estimated camera neutral color in the native sensor colorspace at |
| 3414 | * the time of capture.</p> |
| 3415 | * <p>This value gives the neutral color point encoded as an RGB value in the |
| 3416 | * native sensor color space. The neutral color point indicates the |
| 3417 | * currently estimated white point of the scene illumination. It can be |
| 3418 | * used to interpolate between the provided color transforms when |
| 3419 | * processing raw sensor data.</p> |
| 3420 | * <p>The order of the values is R, G, B; where R is in the lowest index.</p> |
Ruben Brunk | 20c76f6 | 2014-02-07 15:47:10 -0800 | [diff] [blame] | 3421 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 3422 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 3423 | @PublicKey |
Ruben Brunk | 20c76f6 | 2014-02-07 15:47:10 -0800 | [diff] [blame] | 3424 | public static final Key<Rational[]> SENSOR_NEUTRAL_COLOR_POINT = |
| 3425 | new Key<Rational[]>("android.sensor.neutralColorPoint", Rational[].class); |
| 3426 | |
| 3427 | /** |
Ruben Brunk | 1b1f1b6 | 2014-07-23 17:49:08 -0700 | [diff] [blame] | 3428 | * <p>Noise model coefficients for each CFA mosaic channel.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3429 | * <p>This key contains two noise model coefficients for each CFA channel |
Ruben Brunk | 1b1f1b6 | 2014-07-23 17:49:08 -0700 | [diff] [blame] | 3430 | * corresponding to the sensor amplification (S) and sensor readout |
| 3431 | * noise (O). These are given as pairs of coefficients for each channel |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3432 | * in the same order as channels listed for the CFA layout key |
Ruben Brunk | 1b1f1b6 | 2014-07-23 17:49:08 -0700 | [diff] [blame] | 3433 | * (see {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT android.sensor.info.colorFilterArrangement}). This is |
| 3434 | * represented as an array of Pair<Double, Double>, where |
| 3435 | * the first member of the Pair at index n is the S coefficient and the |
| 3436 | * second member is the O coefficient for the nth color channel in the CFA.</p> |
| 3437 | * <p>These coefficients are used in a two parameter noise model to describe |
| 3438 | * the amount of noise present in the image for each CFA channel. The |
| 3439 | * noise model used here is:</p> |
| 3440 | * <p>N(x) = sqrt(Sx + O)</p> |
| 3441 | * <p>Where x represents the recorded signal of a CFA channel normalized to |
| 3442 | * the range [0, 1], and S and O are the noise model coeffiecients for |
| 3443 | * that channel.</p> |
| 3444 | * <p>A more detailed description of the noise model can be found in the |
| 3445 | * Adobe DNG specification for the NoiseProfile tag.</p> |
| 3446 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 3447 | * |
| 3448 | * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT |
| 3449 | */ |
| 3450 | @PublicKey |
| 3451 | public static final Key<android.util.Pair<Double,Double>[]> SENSOR_NOISE_PROFILE = |
| 3452 | new Key<android.util.Pair<Double,Double>[]>("android.sensor.noiseProfile", new TypeReference<android.util.Pair<Double,Double>[]>() {{ }}); |
| 3453 | |
| 3454 | /** |
Ruben Brunk | 987d9f7 | 2014-02-11 18:00:24 -0800 | [diff] [blame] | 3455 | * <p>The worst-case divergence between Bayer green channels.</p> |
| 3456 | * <p>This value is an estimate of the worst case split between the |
| 3457 | * Bayer green channels in the red and blue rows in the sensor color |
| 3458 | * filter array.</p> |
| 3459 | * <p>The green split is calculated as follows:</p> |
| 3460 | * <ol> |
Ruben Brunk | e89b120 | 2014-03-24 17:10:35 -0700 | [diff] [blame] | 3461 | * <li>A 5x5 pixel (or larger) window W within the active sensor array is |
| 3462 | * chosen. The term 'pixel' here is taken to mean a group of 4 Bayer |
| 3463 | * mosaic channels (R, Gr, Gb, B). The location and size of the window |
| 3464 | * chosen is implementation defined, and should be chosen to provide a |
| 3465 | * green split estimate that is both representative of the entire image |
| 3466 | * for this camera sensor, and can be calculated quickly.</li> |
Ruben Brunk | 987d9f7 | 2014-02-11 18:00:24 -0800 | [diff] [blame] | 3467 | * <li>The arithmetic mean of the green channels from the red |
| 3468 | * rows (mean_Gr) within W is computed.</li> |
| 3469 | * <li>The arithmetic mean of the green channels from the blue |
| 3470 | * rows (mean_Gb) within W is computed.</li> |
| 3471 | * <li>The maximum ratio R of the two means is computed as follows: |
| 3472 | * <code>R = max((mean_Gr + 1)/(mean_Gb + 1), (mean_Gb + 1)/(mean_Gr + 1))</code></li> |
| 3473 | * </ol> |
| 3474 | * <p>The ratio R is the green split divergence reported for this property, |
| 3475 | * which represents how much the green channels differ in the mosaic |
| 3476 | * pattern. This value is typically used to determine the treatment of |
| 3477 | * the green mosaic channels when demosaicing.</p> |
| 3478 | * <p>The green split value can be roughly interpreted as follows:</p> |
| 3479 | * <ul> |
| 3480 | * <li>R < 1.03 is a negligible split (<3% divergence).</li> |
| 3481 | * <li>1.20 <= R >= 1.03 will require some software |
| 3482 | * correction to avoid demosaic errors (3-20% divergence).</li> |
| 3483 | * <li>R > 1.20 will require strong software correction to produce |
| 3484 | * a usuable image (>20% divergence).</li> |
| 3485 | * </ul> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3486 | * <p><b>Range of valid values:</b><br></p> |
| 3487 | * <p>>= 0</p> |
Ruben Brunk | 987d9f7 | 2014-02-11 18:00:24 -0800 | [diff] [blame] | 3488 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 3489 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 3490 | @PublicKey |
Ruben Brunk | 987d9f7 | 2014-02-11 18:00:24 -0800 | [diff] [blame] | 3491 | public static final Key<Float> SENSOR_GREEN_SPLIT = |
| 3492 | new Key<Float>("android.sensor.greenSplit", float.class); |
| 3493 | |
| 3494 | /** |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 3495 | * <p>A pixel <code>[R, G_even, G_odd, B]</code> that supplies the test pattern |
| 3496 | * when {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode} is SOLID_COLOR.</p> |
| 3497 | * <p>Each color channel is treated as an unsigned 32-bit integer. |
| 3498 | * The camera device then uses the most significant X bits |
| 3499 | * that correspond to how many bits are in its Bayer raw sensor |
| 3500 | * output.</p> |
| 3501 | * <p>For example, a sensor with RAW10 Bayer output would use the |
| 3502 | * 10 most significant bits from each color channel.</p> |
| 3503 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 3504 | * |
| 3505 | * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE |
| 3506 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 3507 | @PublicKey |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 3508 | public static final Key<int[]> SENSOR_TEST_PATTERN_DATA = |
| 3509 | new Key<int[]>("android.sensor.testPatternData", int[].class); |
| 3510 | |
| 3511 | /** |
Igor Murashkin | c127f05 | 2014-01-17 18:06:02 -0800 | [diff] [blame] | 3512 | * <p>When enabled, the sensor sends a test pattern instead of |
| 3513 | * doing a real exposure from the camera.</p> |
| 3514 | * <p>When a test pattern is enabled, all manual sensor controls specified |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 3515 | * by android.sensor.* will be ignored. All other controls should |
Igor Murashkin | c127f05 | 2014-01-17 18:06:02 -0800 | [diff] [blame] | 3516 | * work as normal.</p> |
| 3517 | * <p>For example, if manual flash is enabled, flash firing should still |
| 3518 | * occur (and that the test pattern remain unmodified, since the flash |
| 3519 | * would not actually affect it).</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3520 | * <p>Defaults to OFF.</p> |
| 3521 | * <p><b>Possible values:</b> |
| 3522 | * <ul> |
| 3523 | * <li>{@link #SENSOR_TEST_PATTERN_MODE_OFF OFF}</li> |
| 3524 | * <li>{@link #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR SOLID_COLOR}</li> |
| 3525 | * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS COLOR_BARS}</li> |
| 3526 | * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY COLOR_BARS_FADE_TO_GRAY}</li> |
| 3527 | * <li>{@link #SENSOR_TEST_PATTERN_MODE_PN9 PN9}</li> |
| 3528 | * <li>{@link #SENSOR_TEST_PATTERN_MODE_CUSTOM1 CUSTOM1}</li> |
| 3529 | * </ul></p> |
| 3530 | * <p><b>Available values for this device:</b><br> |
| 3531 | * {@link CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES android.sensor.availableTestPatternModes}</p> |
Igor Murashkin | c127f05 | 2014-01-17 18:06:02 -0800 | [diff] [blame] | 3532 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3533 | * |
| 3534 | * @see CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES |
Igor Murashkin | c127f05 | 2014-01-17 18:06:02 -0800 | [diff] [blame] | 3535 | * @see #SENSOR_TEST_PATTERN_MODE_OFF |
| 3536 | * @see #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR |
| 3537 | * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS |
| 3538 | * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY |
| 3539 | * @see #SENSOR_TEST_PATTERN_MODE_PN9 |
| 3540 | * @see #SENSOR_TEST_PATTERN_MODE_CUSTOM1 |
| 3541 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 3542 | @PublicKey |
Igor Murashkin | c127f05 | 2014-01-17 18:06:02 -0800 | [diff] [blame] | 3543 | public static final Key<Integer> SENSOR_TEST_PATTERN_MODE = |
| 3544 | new Key<Integer>("android.sensor.testPatternMode", int.class); |
| 3545 | |
| 3546 | /** |
Zhijun He | 0bda31a | 2014-06-13 14:38:39 -0700 | [diff] [blame] | 3547 | * <p>Duration between the start of first row exposure |
| 3548 | * and the start of last row exposure.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3549 | * <p>This is the exposure time skew between the first and last |
| 3550 | * row exposure start times. The first row and the last row are |
| 3551 | * the first and last rows inside of the |
| 3552 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p> |
Zhijun He | 0bda31a | 2014-06-13 14:38:39 -0700 | [diff] [blame] | 3553 | * <p>For typical camera sensors that use rolling shutters, this is also equivalent |
| 3554 | * to the frame readout time.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3555 | * <p><b>Units</b>: Nanoseconds</p> |
| 3556 | * <p><b>Range of valid values:</b><br> |
| 3557 | * >= 0 and < |
Eino-Ville Talvala | b6eb52f | 2015-04-16 16:39:45 -0700 | [diff] [blame] | 3558 | * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration }.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3559 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 3560 | * <p><b>Limited capability</b> - |
| 3561 | * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the |
| 3562 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Zhijun He | 0bda31a | 2014-06-13 14:38:39 -0700 | [diff] [blame] | 3563 | * |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3564 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Zhijun He | 0bda31a | 2014-06-13 14:38:39 -0700 | [diff] [blame] | 3565 | * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE |
| 3566 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 3567 | @PublicKey |
Zhijun He | 0bda31a | 2014-06-13 14:38:39 -0700 | [diff] [blame] | 3568 | public static final Key<Long> SENSOR_ROLLING_SHUTTER_SKEW = |
| 3569 | new Key<Long>("android.sensor.rollingShutterSkew", long.class); |
| 3570 | |
| 3571 | /** |
Zhijun He | cd950b6 | 2015-11-12 17:47:52 -0800 | [diff] [blame] | 3572 | * <p>A per-frame dynamic black level offset for each of the color filter |
| 3573 | * arrangement (CFA) mosaic channels.</p> |
| 3574 | * <p>Camera sensor black levels may vary dramatically for different |
| 3575 | * capture settings (e.g. {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}). The fixed black |
| 3576 | * level reported by {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern} may be too |
| 3577 | * inaccurate to represent the actual value on a per-frame basis. The |
| 3578 | * camera device internal pipeline relies on reliable black level values |
| 3579 | * to process the raw images appropriately. To get the best image |
| 3580 | * quality, the camera device may choose to estimate the per frame black |
| 3581 | * level values either based on optically shielded black regions |
| 3582 | * ({@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions}) or its internal model.</p> |
| 3583 | * <p>This key reports the camera device estimated per-frame zero light |
| 3584 | * value for each of the CFA mosaic channels in the camera sensor. The |
| 3585 | * {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern} may only represent a coarse |
| 3586 | * approximation of the actual black level values. This value is the |
| 3587 | * black level used in camera device internal image processing pipeline |
| 3588 | * and generally more accurate than the fixed black level values. |
| 3589 | * However, since they are estimated values by the camera device, they |
| 3590 | * may not be as accurate as the black level values calculated from the |
| 3591 | * optical black pixels reported by {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions}.</p> |
| 3592 | * <p>The values are given in the same order as channels listed for the CFA |
| 3593 | * layout key (see {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT android.sensor.info.colorFilterArrangement}), i.e. the |
| 3594 | * nth value given corresponds to the black level offset for the nth |
| 3595 | * color channel listed in the CFA.</p> |
Eino-Ville Talvala | 9dc7ec1 | 2017-11-10 15:23:00 -0800 | [diff] [blame] | 3596 | * <p>This key will be available if {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions} is available or the |
| 3597 | * camera device advertises this key via {@link android.hardware.camera2.CameraCharacteristics#getAvailableCaptureResultKeys }.</p> |
Zhijun He | cd950b6 | 2015-11-12 17:47:52 -0800 | [diff] [blame] | 3598 | * <p><b>Range of valid values:</b><br> |
| 3599 | * >= 0 for each.</p> |
| 3600 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 3601 | * |
| 3602 | * @see CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN |
| 3603 | * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT |
| 3604 | * @see CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS |
| 3605 | * @see CaptureRequest#SENSOR_SENSITIVITY |
| 3606 | */ |
| 3607 | @PublicKey |
Zhijun He | 8998ad9 | 2015-11-24 14:31:04 -0800 | [diff] [blame] | 3608 | public static final Key<float[]> SENSOR_DYNAMIC_BLACK_LEVEL = |
| 3609 | new Key<float[]>("android.sensor.dynamicBlackLevel", float[].class); |
Zhijun He | cd950b6 | 2015-11-12 17:47:52 -0800 | [diff] [blame] | 3610 | |
| 3611 | /** |
| 3612 | * <p>Maximum raw value output by sensor for this frame.</p> |
Eino-Ville Talvala | c7c569d | 2016-04-04 10:48:38 -0700 | [diff] [blame] | 3613 | * <p>Since the {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern} may change for different |
Zhijun He | cd950b6 | 2015-11-12 17:47:52 -0800 | [diff] [blame] | 3614 | * capture settings (e.g., {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}), the white |
| 3615 | * level will change accordingly. This key is similar to |
| 3616 | * {@link CameraCharacteristics#SENSOR_INFO_WHITE_LEVEL android.sensor.info.whiteLevel}, but specifies the camera device |
| 3617 | * estimated white level for each frame.</p> |
| 3618 | * <p>This key will be available if {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions} is |
| 3619 | * available or the camera device advertises this key via |
| 3620 | * {@link android.hardware.camera2.CameraCharacteristics#getAvailableCaptureRequestKeys }.</p> |
| 3621 | * <p><b>Range of valid values:</b><br> |
| 3622 | * >= 0</p> |
| 3623 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 3624 | * |
Eino-Ville Talvala | c7c569d | 2016-04-04 10:48:38 -0700 | [diff] [blame] | 3625 | * @see CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN |
Zhijun He | cd950b6 | 2015-11-12 17:47:52 -0800 | [diff] [blame] | 3626 | * @see CameraCharacteristics#SENSOR_INFO_WHITE_LEVEL |
| 3627 | * @see CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS |
| 3628 | * @see CaptureRequest#SENSOR_SENSITIVITY |
| 3629 | */ |
| 3630 | @PublicKey |
| 3631 | public static final Key<Integer> SENSOR_DYNAMIC_WHITE_LEVEL = |
| 3632 | new Key<Integer>("android.sensor.dynamicWhiteLevel", int.class); |
| 3633 | |
| 3634 | /** |
Zhijun He | ba93fe6 | 2014-01-17 16:43:05 -0800 | [diff] [blame] | 3635 | * <p>Quality of lens shading correction applied |
| 3636 | * to the image data.</p> |
| 3637 | * <p>When set to OFF mode, no lens shading correction will be applied by the |
| 3638 | * camera device, and an identity lens shading map data will be provided |
| 3639 | * if <code>{@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} == ON</code>. For example, for lens |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3640 | * shading map with size of <code>[ 4, 3 ]</code>, |
| 3641 | * the output {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap} for this case will be an identity |
| 3642 | * map shown below:</p> |
Zhijun He | ba93fe6 | 2014-01-17 16:43:05 -0800 | [diff] [blame] | 3643 | * <pre><code>[ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3644 | * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, |
| 3645 | * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, |
| 3646 | * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, |
| 3647 | * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, |
| 3648 | * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] |
Zhijun He | ba93fe6 | 2014-01-17 16:43:05 -0800 | [diff] [blame] | 3649 | * </code></pre> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3650 | * <p>When set to other modes, lens shading correction will be applied by the camera |
| 3651 | * device. Applications can request lens shading map data by setting |
| 3652 | * {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} to ON, and then the camera device will provide lens |
| 3653 | * shading map data in {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap}; the returned shading map |
| 3654 | * data will be the one applied by the camera device for this capture request.</p> |
| 3655 | * <p>The shading map data may depend on the auto-exposure (AE) and AWB statistics, therefore |
| 3656 | * the reliability of the map data may be affected by the AE and AWB algorithms. When AE and |
| 3657 | * 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> |
| 3658 | * OFF), to get best results, it is recommended that the applications wait for the AE and AWB |
| 3659 | * to be converged before using the returned shading map data.</p> |
| 3660 | * <p><b>Possible values:</b> |
| 3661 | * <ul> |
| 3662 | * <li>{@link #SHADING_MODE_OFF OFF}</li> |
| 3663 | * <li>{@link #SHADING_MODE_FAST FAST}</li> |
| 3664 | * <li>{@link #SHADING_MODE_HIGH_QUALITY HIGH_QUALITY}</li> |
| 3665 | * </ul></p> |
Yin-Chia Yeh | e4aa283 | 2015-02-06 15:15:53 -0800 | [diff] [blame] | 3666 | * <p><b>Available values for this device:</b><br> |
| 3667 | * {@link CameraCharacteristics#SHADING_AVAILABLE_MODES android.shading.availableModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3668 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 3669 | * <p><b>Full capability</b> - |
| 3670 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 3671 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Zhijun He | ba93fe6 | 2014-01-17 16:43:05 -0800 | [diff] [blame] | 3672 | * |
Zhijun He | fa7c755 | 2014-05-22 16:36:02 -0700 | [diff] [blame] | 3673 | * @see CaptureRequest#CONTROL_AE_MODE |
| 3674 | * @see CaptureRequest#CONTROL_AWB_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3675 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Yin-Chia Yeh | e4aa283 | 2015-02-06 15:15:53 -0800 | [diff] [blame] | 3676 | * @see CameraCharacteristics#SHADING_AVAILABLE_MODES |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3677 | * @see CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP |
Zhijun He | ba93fe6 | 2014-01-17 16:43:05 -0800 | [diff] [blame] | 3678 | * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE |
| 3679 | * @see #SHADING_MODE_OFF |
| 3680 | * @see #SHADING_MODE_FAST |
| 3681 | * @see #SHADING_MODE_HIGH_QUALITY |
Zhijun He | ba93fe6 | 2014-01-17 16:43:05 -0800 | [diff] [blame] | 3682 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 3683 | @PublicKey |
Zhijun He | ba93fe6 | 2014-01-17 16:43:05 -0800 | [diff] [blame] | 3684 | public static final Key<Integer> SHADING_MODE = |
| 3685 | new Key<Integer>("android.shading.mode", int.class); |
| 3686 | |
| 3687 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3688 | * <p>Operating mode for the face detector |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 3689 | * unit.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3690 | * <p>Whether face detection is enabled, and whether it |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3691 | * should output just the basic fields or the full set of |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3692 | * fields.</p> |
| 3693 | * <p><b>Possible values:</b> |
| 3694 | * <ul> |
| 3695 | * <li>{@link #STATISTICS_FACE_DETECT_MODE_OFF OFF}</li> |
| 3696 | * <li>{@link #STATISTICS_FACE_DETECT_MODE_SIMPLE SIMPLE}</li> |
| 3697 | * <li>{@link #STATISTICS_FACE_DETECT_MODE_FULL FULL}</li> |
| 3698 | * </ul></p> |
| 3699 | * <p><b>Available values for this device:</b><br> |
| 3700 | * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}</p> |
| 3701 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 3702 | * |
| 3703 | * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3704 | * @see #STATISTICS_FACE_DETECT_MODE_OFF |
| 3705 | * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE |
| 3706 | * @see #STATISTICS_FACE_DETECT_MODE_FULL |
| 3707 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 3708 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3709 | public static final Key<Integer> STATISTICS_FACE_DETECT_MODE = |
| 3710 | new Key<Integer>("android.statistics.faceDetectMode", int.class); |
| 3711 | |
| 3712 | /** |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 3713 | * <p>List of unique IDs for detected faces.</p> |
| 3714 | * <p>Each detected face is given a unique ID that is valid for as long as the face is visible |
| 3715 | * to the camera device. A face that leaves the field of view and later returns may be |
| 3716 | * assigned a new ID.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3717 | * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL |
| 3718 | * This key is available on all devices.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 3719 | * |
| 3720 | * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE |
Zhijun He | 7f80d6f | 2013-11-04 10:18:05 -0800 | [diff] [blame] | 3721 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3722 | */ |
Mathew Inwood | bcbe440 | 2018-08-08 15:42:59 +0100 | [diff] [blame^] | 3723 | @UnsupportedAppUsage |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3724 | public static final Key<int[]> STATISTICS_FACE_IDS = |
| 3725 | new Key<int[]>("android.statistics.faceIds", int[].class); |
| 3726 | |
| 3727 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3728 | * <p>List of landmarks for detected |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 3729 | * faces.</p> |
Yin-Chia Yeh | 6c73e40 | 2018-06-15 15:37:08 -0700 | [diff] [blame] | 3730 | * <p>For devices not supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate |
| 3731 | * system always follows that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being |
| 3732 | * the top-left pixel of the active array.</p> |
| 3733 | * <p>For devices supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate |
| 3734 | * system depends on the mode being set. |
| 3735 | * When the distortion correction mode is OFF, the coordinate system follows |
| 3736 | * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, with |
| 3737 | * <code>(0, 0)</code> being the top-left pixel of the pre-correction active array. |
| 3738 | * When the distortion correction mode is not OFF, the coordinate system follows |
| 3739 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 3740 | * <code>(0, 0)</code> being the top-left pixel of the active array.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3741 | * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL |
| 3742 | * This key is available on all devices.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 3743 | * |
Yin-Chia Yeh | 6c73e40 | 2018-06-15 15:37:08 -0700 | [diff] [blame] | 3744 | * @see CaptureRequest#DISTORTION_CORRECTION_MODE |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 3745 | * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE |
Yin-Chia Yeh | 6c73e40 | 2018-06-15 15:37:08 -0700 | [diff] [blame] | 3746 | * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 3747 | * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE |
Zhijun He | 7f80d6f | 2013-11-04 10:18:05 -0800 | [diff] [blame] | 3748 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3749 | */ |
Mathew Inwood | bcbe440 | 2018-08-08 15:42:59 +0100 | [diff] [blame^] | 3750 | @UnsupportedAppUsage |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3751 | public static final Key<int[]> STATISTICS_FACE_LANDMARKS = |
| 3752 | new Key<int[]>("android.statistics.faceLandmarks", int[].class); |
| 3753 | |
| 3754 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3755 | * <p>List of the bounding rectangles for detected |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 3756 | * faces.</p> |
Yin-Chia Yeh | 6c73e40 | 2018-06-15 15:37:08 -0700 | [diff] [blame] | 3757 | * <p>For devices not supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate |
| 3758 | * system always follows that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being |
| 3759 | * the top-left pixel of the active array.</p> |
| 3760 | * <p>For devices supporting {@link CaptureRequest#DISTORTION_CORRECTION_MODE android.distortionCorrection.mode} control, the coordinate |
| 3761 | * system depends on the mode being set. |
| 3762 | * When the distortion correction mode is OFF, the coordinate system follows |
| 3763 | * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, with |
| 3764 | * <code>(0, 0)</code> being the top-left pixel of the pre-correction active array. |
| 3765 | * When the distortion correction mode is not OFF, the coordinate system follows |
| 3766 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 3767 | * <code>(0, 0)</code> being the top-left pixel of the active array.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3768 | * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} != OFF |
| 3769 | * This key is available on all devices.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 3770 | * |
Yin-Chia Yeh | 6c73e40 | 2018-06-15 15:37:08 -0700 | [diff] [blame] | 3771 | * @see CaptureRequest#DISTORTION_CORRECTION_MODE |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 3772 | * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE |
Yin-Chia Yeh | 6c73e40 | 2018-06-15 15:37:08 -0700 | [diff] [blame] | 3773 | * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 3774 | * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE |
Zhijun He | 7f80d6f | 2013-11-04 10:18:05 -0800 | [diff] [blame] | 3775 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3776 | */ |
Mathew Inwood | bcbe440 | 2018-08-08 15:42:59 +0100 | [diff] [blame^] | 3777 | @UnsupportedAppUsage |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3778 | public static final Key<android.graphics.Rect[]> STATISTICS_FACE_RECTANGLES = |
| 3779 | new Key<android.graphics.Rect[]>("android.statistics.faceRectangles", android.graphics.Rect[].class); |
| 3780 | |
| 3781 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3782 | * <p>List of the face confidence scores for |
| 3783 | * detected faces</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 3784 | * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} != OFF.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3785 | * <p><b>Range of valid values:</b><br> |
| 3786 | * 1-100</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3787 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 3788 | * |
| 3789 | * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE |
Zhijun He | 7f80d6f | 2013-11-04 10:18:05 -0800 | [diff] [blame] | 3790 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3791 | */ |
Mathew Inwood | bcbe440 | 2018-08-08 15:42:59 +0100 | [diff] [blame^] | 3792 | @UnsupportedAppUsage |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3793 | public static final Key<byte[]> STATISTICS_FACE_SCORES = |
| 3794 | new Key<byte[]>("android.statistics.faceScores", byte[].class); |
| 3795 | |
| 3796 | /** |
Igor Murashkin | 72f9f0a | 2014-05-14 15:46:10 -0700 | [diff] [blame] | 3797 | * <p>List of the faces detected through camera face detection |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3798 | * in this capture.</p> |
Igor Murashkin | 72f9f0a | 2014-05-14 15:46:10 -0700 | [diff] [blame] | 3799 | * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} <code>!=</code> OFF.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3800 | * <p>This key is available on all devices.</p> |
Igor Murashkin | 72f9f0a | 2014-05-14 15:46:10 -0700 | [diff] [blame] | 3801 | * |
| 3802 | * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE |
| 3803 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 3804 | @PublicKey |
| 3805 | @SyntheticKey |
Igor Murashkin | 72f9f0a | 2014-05-14 15:46:10 -0700 | [diff] [blame] | 3806 | public static final Key<android.hardware.camera2.params.Face[]> STATISTICS_FACES = |
| 3807 | new Key<android.hardware.camera2.params.Face[]>("android.statistics.faces", android.hardware.camera2.params.Face[].class); |
| 3808 | |
| 3809 | /** |
Igor Murashkin | 7a9b30e | 2013-12-11 13:31:38 -0800 | [diff] [blame] | 3810 | * <p>The shading map is a low-resolution floating-point map |
| 3811 | * that lists the coefficients used to correct for vignetting, for each |
| 3812 | * Bayer color channel.</p> |
Eino-Ville Talvala | c62cea8 | 2016-06-02 14:21:27 -0700 | [diff] [blame] | 3813 | * <p>The map provided here is the same map that is used by the camera device to |
| 3814 | * correct both color shading and vignetting for output non-RAW images.</p> |
| 3815 | * <p>When there is no lens shading correction applied to RAW |
| 3816 | * output images ({@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied} <code>==</code> |
| 3817 | * false), this map is the complete lens shading correction |
| 3818 | * map; when there is some lens shading correction applied to |
| 3819 | * the RAW output image ({@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied}<code>==</code> true), this map reports the remaining lens shading |
| 3820 | * correction map that needs to be applied to get shading |
| 3821 | * corrected images that match the camera device's output for |
| 3822 | * non-RAW formats.</p> |
| 3823 | * <p>For a complete shading correction map, the least shaded |
| 3824 | * section of the image will have a gain factor of 1; all |
| 3825 | * other sections will have gains above 1.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 3826 | * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map |
Eino-Ville Talvala | c62cea8 | 2016-06-02 14:21:27 -0700 | [diff] [blame] | 3827 | * will take into account the colorCorrection settings.</p> |
Igor Murashkin | 7a9b30e | 2013-12-11 13:31:38 -0800 | [diff] [blame] | 3828 | * <p>The shading map is for the entire active pixel array, and is not |
| 3829 | * affected by the crop region specified in the request. Each shading map |
| 3830 | * entry is the value of the shading compensation map over a specific |
| 3831 | * pixel on the sensor. Specifically, with a (N x M) resolution shading |
| 3832 | * map, and an active pixel array size (W x H), shading map entry |
| 3833 | * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at |
| 3834 | * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels. |
| 3835 | * The map is assumed to be bilinearly interpolated between the sample points.</p> |
| 3836 | * <p>The channel order is [R, Geven, Godd, B], where Geven is the green |
| 3837 | * channel for the even rows of a Bayer pattern, and Godd is the odd rows. |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 3838 | * The shading map is stored in a fully interleaved format.</p> |
Eino-Ville Talvala | c62cea8 | 2016-06-02 14:21:27 -0700 | [diff] [blame] | 3839 | * <p>The shading map will generally have on the order of 30-40 rows and columns, |
| 3840 | * and will be smaller than 64x64.</p> |
Igor Murashkin | 7a9b30e | 2013-12-11 13:31:38 -0800 | [diff] [blame] | 3841 | * <p>As an example, given a very small map defined as:</p> |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 3842 | * <pre><code>width,height = [ 4, 3 ] |
| 3843 | * values = |
Igor Murashkin | 7a9b30e | 2013-12-11 13:31:38 -0800 | [diff] [blame] | 3844 | * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2, |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3845 | * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3, |
| 3846 | * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0, |
| 3847 | * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2, |
| 3848 | * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2, |
| 3849 | * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ] |
Igor Murashkin | 7a9b30e | 2013-12-11 13:31:38 -0800 | [diff] [blame] | 3850 | * </code></pre> |
| 3851 | * <p>The low-resolution scaling map images for each channel are |
| 3852 | * (displayed using nearest-neighbor interpolation):</p> |
Eino-Ville Talvala | 9dc7ec1 | 2017-11-10 15:23:00 -0800 | [diff] [blame] | 3853 | * <p><img alt="Red lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" /> |
| 3854 | * <img alt="Green (even rows) lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" /> |
| 3855 | * <img alt="Green (odd rows) lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" /> |
| 3856 | * <img alt="Blue lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/blue_shading.png" /></p> |
Igor Murashkin | 7a9b30e | 2013-12-11 13:31:38 -0800 | [diff] [blame] | 3857 | * <p>As a visualization only, inverting the full-color map to recover an |
| 3858 | * image of a gray wall (using bicubic interpolation for visual quality) as captured by the sensor gives:</p> |
Eino-Ville Talvala | 9dc7ec1 | 2017-11-10 15:23:00 -0800 | [diff] [blame] | 3859 | * <p><img alt="Image of a uniform white wall (inverse shading map)" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/inv_shading.png" /></p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3860 | * <p><b>Range of valid values:</b><br> |
| 3861 | * Each gain factor is >= 1</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3862 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 3863 | * <p><b>Full capability</b> - |
| 3864 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 3865 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 3866 | * |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 3867 | * @see CaptureRequest#COLOR_CORRECTION_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3868 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | c62cea8 | 2016-06-02 14:21:27 -0700 | [diff] [blame] | 3869 | * @see CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 3870 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 3871 | @PublicKey |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 3872 | public static final Key<android.hardware.camera2.params.LensShadingMap> STATISTICS_LENS_SHADING_CORRECTION_MAP = |
| 3873 | new Key<android.hardware.camera2.params.LensShadingMap>("android.statistics.lensShadingCorrectionMap", android.hardware.camera2.params.LensShadingMap.class); |
| 3874 | |
| 3875 | /** |
| 3876 | * <p>The shading map is a low-resolution floating-point map |
Zhijun He | 43210fe | 2016-04-12 23:15:23 -0700 | [diff] [blame] | 3877 | * that lists the coefficients used to correct for vignetting and color shading, |
| 3878 | * for each Bayer color channel of RAW image data.</p> |
Eino-Ville Talvala | c62cea8 | 2016-06-02 14:21:27 -0700 | [diff] [blame] | 3879 | * <p>The map provided here is the same map that is used by the camera device to |
| 3880 | * correct both color shading and vignetting for output non-RAW images.</p> |
| 3881 | * <p>When there is no lens shading correction applied to RAW |
| 3882 | * output images ({@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied} <code>==</code> |
| 3883 | * false), this map is the complete lens shading correction |
| 3884 | * map; when there is some lens shading correction applied to |
| 3885 | * the RAW output image ({@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied}<code>==</code> true), this map reports the remaining lens shading |
| 3886 | * correction map that needs to be applied to get shading |
| 3887 | * corrected images that match the camera device's output for |
| 3888 | * non-RAW formats.</p> |
| 3889 | * <p>For a complete shading correction map, the least shaded |
| 3890 | * section of the image will have a gain factor of 1; all |
| 3891 | * other sections will have gains above 1.</p> |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 3892 | * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map |
Eino-Ville Talvala | c62cea8 | 2016-06-02 14:21:27 -0700 | [diff] [blame] | 3893 | * will take into account the colorCorrection settings.</p> |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 3894 | * <p>The shading map is for the entire active pixel array, and is not |
| 3895 | * affected by the crop region specified in the request. Each shading map |
| 3896 | * entry is the value of the shading compensation map over a specific |
| 3897 | * pixel on the sensor. Specifically, with a (N x M) resolution shading |
| 3898 | * map, and an active pixel array size (W x H), shading map entry |
| 3899 | * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at |
| 3900 | * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels. |
| 3901 | * The map is assumed to be bilinearly interpolated between the sample points.</p> |
| 3902 | * <p>The channel order is [R, Geven, Godd, B], where Geven is the green |
| 3903 | * channel for the even rows of a Bayer pattern, and Godd is the odd rows. |
| 3904 | * The shading map is stored in a fully interleaved format, and its size |
| 3905 | * is provided in the camera static metadata by android.lens.info.shadingMapSize.</p> |
Eino-Ville Talvala | c62cea8 | 2016-06-02 14:21:27 -0700 | [diff] [blame] | 3906 | * <p>The shading map will generally have on the order of 30-40 rows and columns, |
| 3907 | * and will be smaller than 64x64.</p> |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 3908 | * <p>As an example, given a very small map defined as:</p> |
| 3909 | * <pre><code>android.lens.info.shadingMapSize = [ 4, 3 ] |
| 3910 | * android.statistics.lensShadingMap = |
| 3911 | * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2, |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3912 | * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3, |
| 3913 | * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0, |
| 3914 | * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2, |
| 3915 | * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2, |
| 3916 | * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ] |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 3917 | * </code></pre> |
| 3918 | * <p>The low-resolution scaling map images for each channel are |
| 3919 | * (displayed using nearest-neighbor interpolation):</p> |
Eino-Ville Talvala | 9dc7ec1 | 2017-11-10 15:23:00 -0800 | [diff] [blame] | 3920 | * <p><img alt="Red lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" /> |
| 3921 | * <img alt="Green (even rows) lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" /> |
| 3922 | * <img alt="Green (odd rows) lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" /> |
| 3923 | * <img alt="Blue lens shading map" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/blue_shading.png" /></p> |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 3924 | * <p>As a visualization only, inverting the full-color map to recover an |
Yin-Chia Yeh | e4aa283 | 2015-02-06 15:15:53 -0800 | [diff] [blame] | 3925 | * image of a gray wall (using bicubic interpolation for visual quality) |
| 3926 | * as captured by the sensor gives:</p> |
Eino-Ville Talvala | 9dc7ec1 | 2017-11-10 15:23:00 -0800 | [diff] [blame] | 3927 | * <p><img alt="Image of a uniform white wall (inverse shading map)" src="/reference/images/camera2/metadata/android.statistics.lensShadingMap/inv_shading.png" /></p> |
Yin-Chia Yeh | e4aa283 | 2015-02-06 15:15:53 -0800 | [diff] [blame] | 3928 | * <p>Note that the RAW image data might be subject to lens shading |
| 3929 | * correction not reported on this map. Query |
| 3930 | * {@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied} to see if RAW image data has subject |
| 3931 | * to lens shading correction. If {@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied} |
| 3932 | * is TRUE, the RAW image data is subject to partial or full lens shading |
| 3933 | * correction. In the case full lens shading correction is applied to RAW |
| 3934 | * images, the gain factor map reported in this key will contain all 1.0 gains. |
| 3935 | * In other words, the map reported in this key is the remaining lens shading |
| 3936 | * that needs to be applied on the RAW image to get images without lens shading |
| 3937 | * artifacts. See {@link CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_RAW android.request.maxNumOutputRaw} for a list of RAW image |
| 3938 | * formats.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3939 | * <p><b>Range of valid values:</b><br> |
| 3940 | * Each gain factor is >= 1</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3941 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 3942 | * <p><b>Full capability</b> - |
| 3943 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 3944 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 3945 | * |
| 3946 | * @see CaptureRequest#COLOR_CORRECTION_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3947 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Yin-Chia Yeh | e4aa283 | 2015-02-06 15:15:53 -0800 | [diff] [blame] | 3948 | * @see CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_RAW |
| 3949 | * @see CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 3950 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3951 | */ |
Mathew Inwood | bcbe440 | 2018-08-08 15:42:59 +0100 | [diff] [blame^] | 3952 | @UnsupportedAppUsage |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3953 | public static final Key<float[]> STATISTICS_LENS_SHADING_MAP = |
| 3954 | new Key<float[]>("android.statistics.lensShadingMap", float[].class); |
| 3955 | |
| 3956 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3957 | * <p>The best-fit color channel gains calculated |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 3958 | * by the camera device's statistics units for the current output frame.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3959 | * <p>This may be different than the gains used for this frame, |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3960 | * since statistics processing on data from a new frame |
| 3961 | * typically completes after the transform has already been |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3962 | * applied to that frame.</p> |
| 3963 | * <p>The 4 channel gains are defined in Bayer domain, |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 3964 | * see {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} for details.</p> |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 3965 | * <p>This value should always be calculated by the auto-white balance (AWB) block, |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3966 | * regardless of the android.control.* current values.</p> |
Igor Murashkin | aef3b7e | 2014-01-15 13:20:37 -0800 | [diff] [blame] | 3967 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 3968 | * |
| 3969 | * @see CaptureRequest#COLOR_CORRECTION_GAINS |
Igor Murashkin | 9c59517 | 2014-05-12 13:56:20 -0700 | [diff] [blame] | 3970 | * @deprecated |
Eino-Ville Talvala | 915f504 | 2018-03-13 19:08:01 -0700 | [diff] [blame] | 3971 | * <p>Never fully implemented or specified; do not use</p> |
| 3972 | |
Igor Murashkin | aef3b7e | 2014-01-15 13:20:37 -0800 | [diff] [blame] | 3973 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3974 | */ |
Igor Murashkin | 9c59517 | 2014-05-12 13:56:20 -0700 | [diff] [blame] | 3975 | @Deprecated |
Mathew Inwood | bcbe440 | 2018-08-08 15:42:59 +0100 | [diff] [blame^] | 3976 | @UnsupportedAppUsage |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3977 | public static final Key<float[]> STATISTICS_PREDICTED_COLOR_GAINS = |
| 3978 | new Key<float[]>("android.statistics.predictedColorGains", float[].class); |
| 3979 | |
| 3980 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3981 | * <p>The best-fit color transform matrix estimate |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 3982 | * calculated by the camera device's statistics units for the current |
| 3983 | * output frame.</p> |
| 3984 | * <p>The camera device will provide the estimate from its |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3985 | * statistics unit on the white balance transforms to use |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 3986 | * for the next frame. These are the values the camera device believes |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3987 | * are the best fit for the current output frame. This may |
| 3988 | * be different than the transform used for this frame, since |
| 3989 | * statistics processing on data from a new frame typically |
| 3990 | * completes after the transform has already been applied to |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3991 | * that frame.</p> |
| 3992 | * <p>These estimates must be provided for all frames, even if |
| 3993 | * capture settings and color transforms are set by the application.</p> |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 3994 | * <p>This value should always be calculated by the auto-white balance (AWB) block, |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3995 | * regardless of the android.control.* current values.</p> |
Igor Murashkin | aef3b7e | 2014-01-15 13:20:37 -0800 | [diff] [blame] | 3996 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
Igor Murashkin | 9c59517 | 2014-05-12 13:56:20 -0700 | [diff] [blame] | 3997 | * @deprecated |
Eino-Ville Talvala | 915f504 | 2018-03-13 19:08:01 -0700 | [diff] [blame] | 3998 | * <p>Never fully implemented or specified; do not use</p> |
| 3999 | |
Igor Murashkin | aef3b7e | 2014-01-15 13:20:37 -0800 | [diff] [blame] | 4000 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 4001 | */ |
Igor Murashkin | 9c59517 | 2014-05-12 13:56:20 -0700 | [diff] [blame] | 4002 | @Deprecated |
Mathew Inwood | bcbe440 | 2018-08-08 15:42:59 +0100 | [diff] [blame^] | 4003 | @UnsupportedAppUsage |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 4004 | public static final Key<Rational[]> STATISTICS_PREDICTED_COLOR_TRANSFORM = |
| 4005 | new Key<Rational[]>("android.statistics.predictedColorTransform", Rational[].class); |
| 4006 | |
| 4007 | /** |
Zhijun He | 208fb6c | 2014-02-03 13:09:06 -0800 | [diff] [blame] | 4008 | * <p>The camera device estimated scene illumination lighting |
| 4009 | * frequency.</p> |
| 4010 | * <p>Many light sources, such as most fluorescent lights, flicker at a rate |
| 4011 | * that depends on the local utility power standards. This flicker must be |
| 4012 | * accounted for by auto-exposure routines to avoid artifacts in captured images. |
| 4013 | * The camera device uses this entry to tell the application what the scene |
| 4014 | * illuminant frequency is.</p> |
| 4015 | * <p>When manual exposure control is enabled |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 4016 | * (<code>{@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} == OFF</code> or <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == |
| 4017 | * OFF</code>), the {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} doesn't perform |
| 4018 | * antibanding, and the application can ensure it selects |
| 4019 | * exposure times that do not cause banding issues by looking |
| 4020 | * into this metadata field. See |
| 4021 | * {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} for more details.</p> |
| 4022 | * <p>Reports NONE if there doesn't appear to be flickering illumination.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 4023 | * <p><b>Possible values:</b> |
| 4024 | * <ul> |
| 4025 | * <li>{@link #STATISTICS_SCENE_FLICKER_NONE NONE}</li> |
| 4026 | * <li>{@link #STATISTICS_SCENE_FLICKER_50HZ 50HZ}</li> |
| 4027 | * <li>{@link #STATISTICS_SCENE_FLICKER_60HZ 60HZ}</li> |
| 4028 | * </ul></p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 4029 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 4030 | * <p><b>Full capability</b> - |
| 4031 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 4032 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Zhijun He | 208fb6c | 2014-02-03 13:09:06 -0800 | [diff] [blame] | 4033 | * |
| 4034 | * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE |
| 4035 | * @see CaptureRequest#CONTROL_AE_MODE |
| 4036 | * @see CaptureRequest#CONTROL_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 4037 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 4038 | * @see #STATISTICS_SCENE_FLICKER_NONE |
| 4039 | * @see #STATISTICS_SCENE_FLICKER_50HZ |
| 4040 | * @see #STATISTICS_SCENE_FLICKER_60HZ |
| 4041 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 4042 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 4043 | public static final Key<Integer> STATISTICS_SCENE_FLICKER = |
| 4044 | new Key<Integer>("android.statistics.sceneFlicker", int.class); |
| 4045 | |
| 4046 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 4047 | * <p>Operating mode for hot pixel map generation.</p> |
| 4048 | * <p>If set to <code>true</code>, a hot pixel map is returned in {@link CaptureResult#STATISTICS_HOT_PIXEL_MAP android.statistics.hotPixelMap}. |
| 4049 | * If set to <code>false</code>, no hot pixel map will be returned.</p> |
| 4050 | * <p><b>Range of valid values:</b><br> |
| 4051 | * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES android.statistics.info.availableHotPixelMapModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 4052 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
Ruben Brunk | 9d454fd | 2014-03-04 14:11:52 -0800 | [diff] [blame] | 4053 | * |
| 4054 | * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP |
| 4055 | * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES |
| 4056 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 4057 | @PublicKey |
Ruben Brunk | 9d454fd | 2014-03-04 14:11:52 -0800 | [diff] [blame] | 4058 | public static final Key<Boolean> STATISTICS_HOT_PIXEL_MAP_MODE = |
| 4059 | new Key<Boolean>("android.statistics.hotPixelMapMode", boolean.class); |
| 4060 | |
| 4061 | /** |
| 4062 | * <p>List of <code>(x, y)</code> coordinates of hot/defective pixels on the sensor.</p> |
| 4063 | * <p>A coordinate <code>(x, y)</code> must lie between <code>(0, 0)</code>, and |
| 4064 | * <code>(width - 1, height - 1)</code> (inclusive), which are the top-left and |
| 4065 | * bottom-right of the pixel array, respectively. The width and |
| 4066 | * height dimensions are given in {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}. |
| 4067 | * This may include hot pixels that lie outside of the active array |
| 4068 | * bounds given by {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 4069 | * <p><b>Range of valid values:</b><br></p> |
| 4070 | * <p>n <= number of pixels on the sensor. |
| 4071 | * The <code>(x, y)</code> coordinates must be bounded by |
| 4072 | * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 4073 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
Ruben Brunk | 9d454fd | 2014-03-04 14:11:52 -0800 | [diff] [blame] | 4074 | * |
| 4075 | * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE |
| 4076 | * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE |
| 4077 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 4078 | @PublicKey |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 4079 | public static final Key<android.graphics.Point[]> STATISTICS_HOT_PIXEL_MAP = |
| 4080 | new Key<android.graphics.Point[]>("android.statistics.hotPixelMap", android.graphics.Point[].class); |
Ruben Brunk | 9d454fd | 2014-03-04 14:11:52 -0800 | [diff] [blame] | 4081 | |
| 4082 | /** |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 4083 | * <p>Whether the camera device will output the lens |
| 4084 | * shading map in output result metadata.</p> |
| 4085 | * <p>When set to ON, |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 4086 | * android.statistics.lensShadingMap will be provided in |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 4087 | * the output result metadata.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 4088 | * <p>ON is always supported on devices with the RAW capability.</p> |
| 4089 | * <p><b>Possible values:</b> |
| 4090 | * <ul> |
| 4091 | * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_OFF OFF}</li> |
| 4092 | * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_ON ON}</li> |
| 4093 | * </ul></p> |
Yin-Chia Yeh | e4aa283 | 2015-02-06 15:15:53 -0800 | [diff] [blame] | 4094 | * <p><b>Available values for this device:</b><br> |
| 4095 | * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES android.statistics.info.availableLensShadingMapModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 4096 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 4097 | * <p><b>Full capability</b> - |
| 4098 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 4099 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
| 4100 | * |
| 4101 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Yin-Chia Yeh | e4aa283 | 2015-02-06 15:15:53 -0800 | [diff] [blame] | 4102 | * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 4103 | * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF |
| 4104 | * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON |
| 4105 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 4106 | @PublicKey |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 4107 | public static final Key<Integer> STATISTICS_LENS_SHADING_MAP_MODE = |
| 4108 | new Key<Integer>("android.statistics.lensShadingMapMode", int.class); |
| 4109 | |
| 4110 | /** |
Eino-Ville Talvala | 08bd163 | 2018-08-01 17:23:09 -0700 | [diff] [blame] | 4111 | * <p>A control for selecting whether optical stabilization (OIS) position |
| 4112 | * information is included in output result metadata.</p> |
| 4113 | * <p>Since optical image stabilization generally involves motion much faster than the duration |
| 4114 | * of individualq image exposure, multiple OIS samples can be included for a single capture |
| 4115 | * result. For example, if the OIS reporting operates at 200 Hz, a typical camera operating |
| 4116 | * at 30fps may have 6-7 OIS samples per capture result. This information can be combined |
| 4117 | * with the rolling shutter skew to account for lens motion during image exposure in |
| 4118 | * post-processing algorithms.</p> |
Chien-Yu Chen | c9cf5b9 | 2018-01-18 12:24:40 -0800 | [diff] [blame] | 4119 | * <p><b>Possible values:</b> |
| 4120 | * <ul> |
| 4121 | * <li>{@link #STATISTICS_OIS_DATA_MODE_OFF OFF}</li> |
| 4122 | * <li>{@link #STATISTICS_OIS_DATA_MODE_ON ON}</li> |
| 4123 | * </ul></p> |
| 4124 | * <p><b>Available values for this device:</b><br> |
Eino-Ville Talvala | 915f504 | 2018-03-13 19:08:01 -0700 | [diff] [blame] | 4125 | * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_OIS_DATA_MODES android.statistics.info.availableOisDataModes}</p> |
Chien-Yu Chen | c9cf5b9 | 2018-01-18 12:24:40 -0800 | [diff] [blame] | 4126 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
Eino-Ville Talvala | 915f504 | 2018-03-13 19:08:01 -0700 | [diff] [blame] | 4127 | * |
| 4128 | * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_OIS_DATA_MODES |
Chien-Yu Chen | c9cf5b9 | 2018-01-18 12:24:40 -0800 | [diff] [blame] | 4129 | * @see #STATISTICS_OIS_DATA_MODE_OFF |
| 4130 | * @see #STATISTICS_OIS_DATA_MODE_ON |
| 4131 | */ |
| 4132 | @PublicKey |
| 4133 | public static final Key<Integer> STATISTICS_OIS_DATA_MODE = |
| 4134 | new Key<Integer>("android.statistics.oisDataMode", int.class); |
| 4135 | |
| 4136 | /** |
| 4137 | * <p>An array of timestamps of OIS samples, in nanoseconds.</p> |
| 4138 | * <p>The array contains the timestamps of OIS samples. The timestamps are in the same |
| 4139 | * timebase as and comparable to {@link CaptureResult#SENSOR_TIMESTAMP android.sensor.timestamp}.</p> |
| 4140 | * <p><b>Units</b>: nanoseconds</p> |
| 4141 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 4142 | * |
| 4143 | * @see CaptureResult#SENSOR_TIMESTAMP |
Chien-Yu Chen | c804d1c | 2018-02-15 12:44:19 -0800 | [diff] [blame] | 4144 | * @hide |
Chien-Yu Chen | c9cf5b9 | 2018-01-18 12:24:40 -0800 | [diff] [blame] | 4145 | */ |
Mathew Inwood | bcbe440 | 2018-08-08 15:42:59 +0100 | [diff] [blame^] | 4146 | @UnsupportedAppUsage |
Chien-Yu Chen | c9cf5b9 | 2018-01-18 12:24:40 -0800 | [diff] [blame] | 4147 | public static final Key<long[]> STATISTICS_OIS_TIMESTAMPS = |
| 4148 | new Key<long[]>("android.statistics.oisTimestamps", long[].class); |
| 4149 | |
| 4150 | /** |
| 4151 | * <p>An array of shifts of OIS samples, in x direction.</p> |
| 4152 | * <p>The array contains the amount of shifts in x direction, in pixels, based on OIS samples. |
Eino-Ville Talvala | 08bd163 | 2018-08-01 17:23:09 -0700 | [diff] [blame] | 4153 | * A positive value is a shift from left to right in the pre-correction active array |
| 4154 | * coordinate system. For example, if the optical center is (1000, 500) in pre-correction |
| 4155 | * active array coordinates, a shift of (3, 0) puts the new optical center at (1003, 500).</p> |
Chien-Yu Chen | c9cf5b9 | 2018-01-18 12:24:40 -0800 | [diff] [blame] | 4156 | * <p>The number of shifts must match the number of timestamps in |
Chien-Yu Chen | c804d1c | 2018-02-15 12:44:19 -0800 | [diff] [blame] | 4157 | * android.statistics.oisTimestamps.</p> |
Eino-Ville Talvala | 08bd163 | 2018-08-01 17:23:09 -0700 | [diff] [blame] | 4158 | * <p>The OIS samples are not affected by whether lens distortion correction is enabled (on |
| 4159 | * supporting devices). They are always reported in pre-correction active array coordinates, |
| 4160 | * since the scaling of OIS shifts would depend on the specific spot on the sensor the shift |
| 4161 | * is needed.</p> |
Chien-Yu Chen | c9cf5b9 | 2018-01-18 12:24:40 -0800 | [diff] [blame] | 4162 | * <p><b>Units</b>: Pixels in active array.</p> |
| 4163 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
Chien-Yu Chen | c804d1c | 2018-02-15 12:44:19 -0800 | [diff] [blame] | 4164 | * @hide |
Chien-Yu Chen | c9cf5b9 | 2018-01-18 12:24:40 -0800 | [diff] [blame] | 4165 | */ |
Mathew Inwood | bcbe440 | 2018-08-08 15:42:59 +0100 | [diff] [blame^] | 4166 | @UnsupportedAppUsage |
Chien-Yu Chen | c9cf5b9 | 2018-01-18 12:24:40 -0800 | [diff] [blame] | 4167 | public static final Key<float[]> STATISTICS_OIS_X_SHIFTS = |
| 4168 | new Key<float[]>("android.statistics.oisXShifts", float[].class); |
| 4169 | |
| 4170 | /** |
| 4171 | * <p>An array of shifts of OIS samples, in y direction.</p> |
| 4172 | * <p>The array contains the amount of shifts in y direction, in pixels, based on OIS samples. |
Eino-Ville Talvala | 08bd163 | 2018-08-01 17:23:09 -0700 | [diff] [blame] | 4173 | * A positive value is a shift from top to bottom in pre-correction active array coordinate |
| 4174 | * system. For example, if the optical center is (1000, 500) in active array coordinates, a |
| 4175 | * shift of (0, 5) puts the new optical center at (1000, 505).</p> |
Chien-Yu Chen | c9cf5b9 | 2018-01-18 12:24:40 -0800 | [diff] [blame] | 4176 | * <p>The number of shifts must match the number of timestamps in |
Chien-Yu Chen | c804d1c | 2018-02-15 12:44:19 -0800 | [diff] [blame] | 4177 | * android.statistics.oisTimestamps.</p> |
Eino-Ville Talvala | 08bd163 | 2018-08-01 17:23:09 -0700 | [diff] [blame] | 4178 | * <p>The OIS samples are not affected by whether lens distortion correction is enabled (on |
| 4179 | * supporting devices). They are always reported in pre-correction active array coordinates, |
| 4180 | * since the scaling of OIS shifts would depend on the specific spot on the sensor the shift |
| 4181 | * is needed.</p> |
Chien-Yu Chen | c9cf5b9 | 2018-01-18 12:24:40 -0800 | [diff] [blame] | 4182 | * <p><b>Units</b>: Pixels in active array.</p> |
| 4183 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
Chien-Yu Chen | c804d1c | 2018-02-15 12:44:19 -0800 | [diff] [blame] | 4184 | * @hide |
Chien-Yu Chen | c9cf5b9 | 2018-01-18 12:24:40 -0800 | [diff] [blame] | 4185 | */ |
Mathew Inwood | bcbe440 | 2018-08-08 15:42:59 +0100 | [diff] [blame^] | 4186 | @UnsupportedAppUsage |
Chien-Yu Chen | c9cf5b9 | 2018-01-18 12:24:40 -0800 | [diff] [blame] | 4187 | public static final Key<float[]> STATISTICS_OIS_Y_SHIFTS = |
| 4188 | new Key<float[]>("android.statistics.oisYShifts", float[].class); |
| 4189 | |
| 4190 | /** |
Eino-Ville Talvala | 08bd163 | 2018-08-01 17:23:09 -0700 | [diff] [blame] | 4191 | * <p>An array of optical stabilization (OIS) position samples.</p> |
Chien-Yu Chen | c804d1c | 2018-02-15 12:44:19 -0800 | [diff] [blame] | 4192 | * <p>Each OIS sample contains the timestamp and the amount of shifts in x and y direction, |
| 4193 | * in pixels, of the OIS sample.</p> |
Eino-Ville Talvala | 08bd163 | 2018-08-01 17:23:09 -0700 | [diff] [blame] | 4194 | * <p>A positive value for a shift in x direction is a shift from left to right in the |
| 4195 | * pre-correction active array coordinate system. For example, if the optical center is |
| 4196 | * (1000, 500) in pre-correction active array coordinates, a shift of (3, 0) puts the new |
| 4197 | * optical center at (1003, 500).</p> |
| 4198 | * <p>A positive value for a shift in y direction is a shift from top to bottom in |
| 4199 | * pre-correction active array coordinate system. For example, if the optical center is |
| 4200 | * (1000, 500) in active array coordinates, a shift of (0, 5) puts the new optical center at |
| 4201 | * (1000, 505).</p> |
| 4202 | * <p>The OIS samples are not affected by whether lens distortion correction is enabled (on |
| 4203 | * supporting devices). They are always reported in pre-correction active array coordinates, |
| 4204 | * since the scaling of OIS shifts would depend on the specific spot on the sensor the shift |
| 4205 | * is needed.</p> |
Chien-Yu Chen | c804d1c | 2018-02-15 12:44:19 -0800 | [diff] [blame] | 4206 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 4207 | */ |
| 4208 | @PublicKey |
| 4209 | @SyntheticKey |
| 4210 | public static final Key<android.hardware.camera2.params.OisSample[]> STATISTICS_OIS_SAMPLES = |
| 4211 | new Key<android.hardware.camera2.params.OisSample[]>("android.statistics.oisSamples", android.hardware.camera2.params.OisSample[].class); |
| 4212 | |
| 4213 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 4214 | * <p>Tonemapping / contrast / gamma curve for the blue |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 4215 | * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is |
| 4216 | * CONTRAST_CURVE.</p> |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 4217 | * <p>See android.tonemap.curveRed for more details.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 4218 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 4219 | * <p><b>Full capability</b> - |
| 4220 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 4221 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 4222 | * |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 4223 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 4224 | * @see CaptureRequest#TONEMAP_MODE |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 4225 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 4226 | */ |
Mathew Inwood | bcbe440 | 2018-08-08 15:42:59 +0100 | [diff] [blame^] | 4227 | @UnsupportedAppUsage |
Zhijun He | 3ffd705 | 2013-08-19 15:45:08 -0700 | [diff] [blame] | 4228 | public static final Key<float[]> TONEMAP_CURVE_BLUE = |
| 4229 | new Key<float[]>("android.tonemap.curveBlue", float[].class); |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 4230 | |
| 4231 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 4232 | * <p>Tonemapping / contrast / gamma curve for the green |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 4233 | * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is |
| 4234 | * CONTRAST_CURVE.</p> |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 4235 | * <p>See android.tonemap.curveRed for more details.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 4236 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 4237 | * <p><b>Full capability</b> - |
| 4238 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 4239 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 4240 | * |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 4241 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 4242 | * @see CaptureRequest#TONEMAP_MODE |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 4243 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 4244 | */ |
Mathew Inwood | bcbe440 | 2018-08-08 15:42:59 +0100 | [diff] [blame^] | 4245 | @UnsupportedAppUsage |
Zhijun He | 3ffd705 | 2013-08-19 15:45:08 -0700 | [diff] [blame] | 4246 | public static final Key<float[]> TONEMAP_CURVE_GREEN = |
| 4247 | new Key<float[]>("android.tonemap.curveGreen", float[].class); |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 4248 | |
| 4249 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 4250 | * <p>Tonemapping / contrast / gamma curve for the red |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 4251 | * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is |
| 4252 | * CONTRAST_CURVE.</p> |
| 4253 | * <p>Each channel's curve is defined by an array of control points:</p> |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 4254 | * <pre><code>android.tonemap.curveRed = |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 4255 | * [ P0in, P0out, P1in, P1out, P2in, P2out, P3in, P3out, ..., PNin, PNout ] |
Zhijun He | 870922b | 2014-02-15 21:47:51 -0800 | [diff] [blame] | 4256 | * 2 <= N <= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 4257 | * <p>These are sorted in order of increasing <code>Pin</code>; it is |
| 4258 | * required that input values 0.0 and 1.0 are included in the list to |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 4259 | * define a complete mapping. For input values between control points, |
| 4260 | * the camera device must linearly interpolate between the control |
| 4261 | * points.</p> |
| 4262 | * <p>Each curve can have an independent number of points, and the number |
| 4263 | * of points can be less than max (that is, the request doesn't have to |
| 4264 | * always provide a curve with number of points equivalent to |
| 4265 | * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p> |
Shuzhen Wang | 51248bf | 2018-03-22 00:04:45 -0700 | [diff] [blame] | 4266 | * <p>For devices with MONOCHROME capability, only red channel is used. Green and blue channels |
| 4267 | * are ignored.</p> |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 4268 | * <p>A few examples, and their corresponding graphical mappings; these |
| 4269 | * only specify the red channel and the precision is limited to 4 |
| 4270 | * digits, for conciseness.</p> |
| 4271 | * <p>Linear mapping:</p> |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 4272 | * <pre><code>android.tonemap.curveRed = [ 0, 0, 1.0, 1.0 ] |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 4273 | * </code></pre> |
Eino-Ville Talvala | 9dc7ec1 | 2017-11-10 15:23:00 -0800 | [diff] [blame] | 4274 | * <p><img alt="Linear mapping curve" src="/reference/images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p> |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 4275 | * <p>Invert mapping:</p> |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 4276 | * <pre><code>android.tonemap.curveRed = [ 0, 1.0, 1.0, 0 ] |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 4277 | * </code></pre> |
Eino-Ville Talvala | 9dc7ec1 | 2017-11-10 15:23:00 -0800 | [diff] [blame] | 4278 | * <p><img alt="Inverting mapping curve" src="/reference/images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p> |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 4279 | * <p>Gamma 1/2.2 mapping, with 16 control points:</p> |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 4280 | * <pre><code>android.tonemap.curveRed = [ |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 4281 | * 0.0000, 0.0000, 0.0667, 0.2920, 0.1333, 0.4002, 0.2000, 0.4812, |
| 4282 | * 0.2667, 0.5484, 0.3333, 0.6069, 0.4000, 0.6594, 0.4667, 0.7072, |
| 4283 | * 0.5333, 0.7515, 0.6000, 0.7928, 0.6667, 0.8317, 0.7333, 0.8685, |
| 4284 | * 0.8000, 0.9035, 0.8667, 0.9370, 0.9333, 0.9691, 1.0000, 1.0000 ] |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 4285 | * </code></pre> |
Eino-Ville Talvala | 9dc7ec1 | 2017-11-10 15:23:00 -0800 | [diff] [blame] | 4286 | * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="/reference/images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p> |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 4287 | * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p> |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 4288 | * <pre><code>android.tonemap.curveRed = [ |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 4289 | * 0.0000, 0.0000, 0.0667, 0.2864, 0.1333, 0.4007, 0.2000, 0.4845, |
| 4290 | * 0.2667, 0.5532, 0.3333, 0.6125, 0.4000, 0.6652, 0.4667, 0.7130, |
| 4291 | * 0.5333, 0.7569, 0.6000, 0.7977, 0.6667, 0.8360, 0.7333, 0.8721, |
| 4292 | * 0.8000, 0.9063, 0.8667, 0.9389, 0.9333, 0.9701, 1.0000, 1.0000 ] |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 4293 | * </code></pre> |
Eino-Ville Talvala | 9dc7ec1 | 2017-11-10 15:23:00 -0800 | [diff] [blame] | 4294 | * <p><img alt="sRGB tonemapping curve" src="/reference/images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 4295 | * <p><b>Range of valid values:</b><br> |
| 4296 | * 0-1 on both input and output coordinates, normalized |
| 4297 | * as a floating-point value such that 0 == black and 1 == white.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 4298 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 4299 | * <p><b>Full capability</b> - |
| 4300 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 4301 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 4302 | * |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 4303 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 4304 | * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 4305 | * @see CaptureRequest#TONEMAP_MODE |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 4306 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 4307 | */ |
Mathew Inwood | bcbe440 | 2018-08-08 15:42:59 +0100 | [diff] [blame^] | 4308 | @UnsupportedAppUsage |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 4309 | public static final Key<float[]> TONEMAP_CURVE_RED = |
| 4310 | new Key<float[]>("android.tonemap.curveRed", float[].class); |
| 4311 | |
| 4312 | /** |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 4313 | * <p>Tonemapping / contrast / gamma curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} |
| 4314 | * is CONTRAST_CURVE.</p> |
| 4315 | * <p>The tonemapCurve consist of three curves for each of red, green, and blue |
| 4316 | * channels respectively. The following example uses the red channel as an |
| 4317 | * example. The same logic applies to green and blue channel. |
| 4318 | * Each channel's curve is defined by an array of control points:</p> |
| 4319 | * <pre><code>curveRed = |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 4320 | * [ P0(in, out), P1(in, out), P2(in, out), P3(in, out), ..., PN(in, out) ] |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 4321 | * 2 <= N <= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre> |
| 4322 | * <p>These are sorted in order of increasing <code>Pin</code>; it is always |
| 4323 | * guaranteed that input values 0.0 and 1.0 are included in the list to |
| 4324 | * define a complete mapping. For input values between control points, |
| 4325 | * the camera device must linearly interpolate between the control |
| 4326 | * points.</p> |
| 4327 | * <p>Each curve can have an independent number of points, and the number |
| 4328 | * of points can be less than max (that is, the request doesn't have to |
| 4329 | * always provide a curve with number of points equivalent to |
| 4330 | * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p> |
Shuzhen Wang | 51248bf | 2018-03-22 00:04:45 -0700 | [diff] [blame] | 4331 | * <p>For devices with MONOCHROME capability, only red channel is used. Green and blue channels |
| 4332 | * are ignored.</p> |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 4333 | * <p>A few examples, and their corresponding graphical mappings; these |
| 4334 | * only specify the red channel and the precision is limited to 4 |
| 4335 | * digits, for conciseness.</p> |
| 4336 | * <p>Linear mapping:</p> |
| 4337 | * <pre><code>curveRed = [ (0, 0), (1.0, 1.0) ] |
| 4338 | * </code></pre> |
Eino-Ville Talvala | 9dc7ec1 | 2017-11-10 15:23:00 -0800 | [diff] [blame] | 4339 | * <p><img alt="Linear mapping curve" src="/reference/images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p> |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 4340 | * <p>Invert mapping:</p> |
| 4341 | * <pre><code>curveRed = [ (0, 1.0), (1.0, 0) ] |
| 4342 | * </code></pre> |
Eino-Ville Talvala | 9dc7ec1 | 2017-11-10 15:23:00 -0800 | [diff] [blame] | 4343 | * <p><img alt="Inverting mapping curve" src="/reference/images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p> |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 4344 | * <p>Gamma 1/2.2 mapping, with 16 control points:</p> |
| 4345 | * <pre><code>curveRed = [ |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 4346 | * (0.0000, 0.0000), (0.0667, 0.2920), (0.1333, 0.4002), (0.2000, 0.4812), |
| 4347 | * (0.2667, 0.5484), (0.3333, 0.6069), (0.4000, 0.6594), (0.4667, 0.7072), |
| 4348 | * (0.5333, 0.7515), (0.6000, 0.7928), (0.6667, 0.8317), (0.7333, 0.8685), |
| 4349 | * (0.8000, 0.9035), (0.8667, 0.9370), (0.9333, 0.9691), (1.0000, 1.0000) ] |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 4350 | * </code></pre> |
Eino-Ville Talvala | 9dc7ec1 | 2017-11-10 15:23:00 -0800 | [diff] [blame] | 4351 | * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="/reference/images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p> |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 4352 | * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p> |
| 4353 | * <pre><code>curveRed = [ |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 4354 | * (0.0000, 0.0000), (0.0667, 0.2864), (0.1333, 0.4007), (0.2000, 0.4845), |
| 4355 | * (0.2667, 0.5532), (0.3333, 0.6125), (0.4000, 0.6652), (0.4667, 0.7130), |
| 4356 | * (0.5333, 0.7569), (0.6000, 0.7977), (0.6667, 0.8360), (0.7333, 0.8721), |
| 4357 | * (0.8000, 0.9063), (0.8667, 0.9389), (0.9333, 0.9701), (1.0000, 1.0000) ] |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 4358 | * </code></pre> |
Eino-Ville Talvala | 9dc7ec1 | 2017-11-10 15:23:00 -0800 | [diff] [blame] | 4359 | * <p><img alt="sRGB tonemapping curve" src="/reference/images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 4360 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 4361 | * <p><b>Full capability</b> - |
| 4362 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 4363 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 4364 | * |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 4365 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 4366 | * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS |
| 4367 | * @see CaptureRequest#TONEMAP_MODE |
| 4368 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 4369 | @PublicKey |
| 4370 | @SyntheticKey |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 4371 | public static final Key<android.hardware.camera2.params.TonemapCurve> TONEMAP_CURVE = |
| 4372 | new Key<android.hardware.camera2.params.TonemapCurve>("android.tonemap.curve", android.hardware.camera2.params.TonemapCurve.class); |
| 4373 | |
| 4374 | /** |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 4375 | * <p>High-level global contrast/gamma/tonemapping control.</p> |
| 4376 | * <p>When switching to an application-defined contrast curve by setting |
| 4377 | * {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} to CONTRAST_CURVE, the curve is defined |
| 4378 | * per-channel with a set of <code>(in, out)</code> points that specify the |
| 4379 | * mapping from input high-bit-depth pixel value to the output |
| 4380 | * low-bit-depth value. Since the actual pixel ranges of both input |
| 4381 | * and output may change depending on the camera pipeline, the values |
| 4382 | * are specified by normalized floating-point numbers.</p> |
| 4383 | * <p>More-complex color mapping operations such as 3D color look-up |
| 4384 | * tables, selective chroma enhancement, or other non-linear color |
| 4385 | * transforms will be disabled when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is |
| 4386 | * CONTRAST_CURVE.</p> |
| 4387 | * <p>When using either FAST or HIGH_QUALITY, the camera device will |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 4388 | * emit its own tonemap curve in {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}. |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 4389 | * These values are always available, and as close as possible to the |
| 4390 | * actually used nonlinear/nonglobal transforms.</p> |
Zhijun He | fa7c755 | 2014-05-22 16:36:02 -0700 | [diff] [blame] | 4391 | * <p>If a request is sent with CONTRAST_CURVE with the camera device's |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 4392 | * provided curve in FAST or HIGH_QUALITY, the image's tonemap will be |
| 4393 | * roughly the same.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 4394 | * <p><b>Possible values:</b> |
| 4395 | * <ul> |
| 4396 | * <li>{@link #TONEMAP_MODE_CONTRAST_CURVE CONTRAST_CURVE}</li> |
| 4397 | * <li>{@link #TONEMAP_MODE_FAST FAST}</li> |
| 4398 | * <li>{@link #TONEMAP_MODE_HIGH_QUALITY HIGH_QUALITY}</li> |
Yin-Chia Yeh | 956c52b | 2015-02-06 11:23:25 -0800 | [diff] [blame] | 4399 | * <li>{@link #TONEMAP_MODE_GAMMA_VALUE GAMMA_VALUE}</li> |
| 4400 | * <li>{@link #TONEMAP_MODE_PRESET_CURVE PRESET_CURVE}</li> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 4401 | * </ul></p> |
| 4402 | * <p><b>Available values for this device:</b><br> |
| 4403 | * {@link CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES android.tonemap.availableToneMapModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 4404 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 4405 | * <p><b>Full capability</b> - |
| 4406 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 4407 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Igor Murashkin | 3242f4f | 2014-01-15 12:27:41 -0800 | [diff] [blame] | 4408 | * |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 4409 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Ruben Brunk | 6dc379c | 2014-03-04 15:04:00 -0800 | [diff] [blame] | 4410 | * @see CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 4411 | * @see CaptureRequest#TONEMAP_CURVE |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 4412 | * @see CaptureRequest#TONEMAP_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 4413 | * @see #TONEMAP_MODE_CONTRAST_CURVE |
| 4414 | * @see #TONEMAP_MODE_FAST |
| 4415 | * @see #TONEMAP_MODE_HIGH_QUALITY |
Yin-Chia Yeh | 956c52b | 2015-02-06 11:23:25 -0800 | [diff] [blame] | 4416 | * @see #TONEMAP_MODE_GAMMA_VALUE |
| 4417 | * @see #TONEMAP_MODE_PRESET_CURVE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 4418 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 4419 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 4420 | public static final Key<Integer> TONEMAP_MODE = |
| 4421 | new Key<Integer>("android.tonemap.mode", int.class); |
| 4422 | |
| 4423 | /** |
Yin-Chia Yeh | 956c52b | 2015-02-06 11:23:25 -0800 | [diff] [blame] | 4424 | * <p>Tonemapping curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is |
| 4425 | * GAMMA_VALUE</p> |
| 4426 | * <p>The tonemap curve will be defined the following formula: |
| 4427 | * * OUT = pow(IN, 1.0 / gamma) |
| 4428 | * where IN and OUT is the input pixel value scaled to range [0.0, 1.0], |
| 4429 | * pow is the power function and gamma is the gamma value specified by this |
| 4430 | * key.</p> |
| 4431 | * <p>The same curve will be applied to all color channels. The camera device |
| 4432 | * may clip the input gamma value to its supported range. The actual applied |
| 4433 | * value will be returned in capture result.</p> |
| 4434 | * <p>The valid range of gamma value varies on different devices, but values |
| 4435 | * within [1.0, 5.0] are guaranteed not to be clipped.</p> |
| 4436 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 4437 | * |
| 4438 | * @see CaptureRequest#TONEMAP_MODE |
| 4439 | */ |
| 4440 | @PublicKey |
| 4441 | public static final Key<Float> TONEMAP_GAMMA = |
| 4442 | new Key<Float>("android.tonemap.gamma", float.class); |
| 4443 | |
| 4444 | /** |
| 4445 | * <p>Tonemapping curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is |
| 4446 | * PRESET_CURVE</p> |
| 4447 | * <p>The tonemap curve will be defined by specified standard.</p> |
| 4448 | * <p>sRGB (approximated by 16 control points):</p> |
Eino-Ville Talvala | 9dc7ec1 | 2017-11-10 15:23:00 -0800 | [diff] [blame] | 4449 | * <p><img alt="sRGB tonemapping curve" src="/reference/images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p> |
Yin-Chia Yeh | 956c52b | 2015-02-06 11:23:25 -0800 | [diff] [blame] | 4450 | * <p>Rec. 709 (approximated by 16 control points):</p> |
Eino-Ville Talvala | 9dc7ec1 | 2017-11-10 15:23:00 -0800 | [diff] [blame] | 4451 | * <p><img alt="Rec. 709 tonemapping curve" src="/reference/images/camera2/metadata/android.tonemap.curveRed/rec709_tonemap.png" /></p> |
Yin-Chia Yeh | 956c52b | 2015-02-06 11:23:25 -0800 | [diff] [blame] | 4452 | * <p>Note that above figures show a 16 control points approximation of preset |
| 4453 | * curves. Camera devices may apply a different approximation to the curve.</p> |
| 4454 | * <p><b>Possible values:</b> |
| 4455 | * <ul> |
| 4456 | * <li>{@link #TONEMAP_PRESET_CURVE_SRGB SRGB}</li> |
| 4457 | * <li>{@link #TONEMAP_PRESET_CURVE_REC709 REC709}</li> |
| 4458 | * </ul></p> |
| 4459 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 4460 | * |
| 4461 | * @see CaptureRequest#TONEMAP_MODE |
| 4462 | * @see #TONEMAP_PRESET_CURVE_SRGB |
| 4463 | * @see #TONEMAP_PRESET_CURVE_REC709 |
| 4464 | */ |
| 4465 | @PublicKey |
| 4466 | public static final Key<Integer> TONEMAP_PRESET_CURVE = |
| 4467 | new Key<Integer>("android.tonemap.presetCurve", int.class); |
| 4468 | |
| 4469 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 4470 | * <p>This LED is nominally used to indicate to the user |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 4471 | * that the camera is powered on and may be streaming images back to the |
| 4472 | * Application Processor. In certain rare circumstances, the OS may |
| 4473 | * disable this when video is processed locally and not transmitted to |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 4474 | * any untrusted applications.</p> |
| 4475 | * <p>In particular, the LED <em>must</em> always be on when the data could be |
| 4476 | * transmitted off the device. The LED <em>should</em> always be on whenever |
| 4477 | * data is stored locally on the device.</p> |
| 4478 | * <p>The LED <em>may</em> be off if a trusted application is using the data that |
| 4479 | * doesn't violate the above rules.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 4480 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 4481 | * @hide |
| 4482 | */ |
Mathew Inwood | bcbe440 | 2018-08-08 15:42:59 +0100 | [diff] [blame^] | 4483 | @UnsupportedAppUsage |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 4484 | public static final Key<Boolean> LED_TRANSMIT = |
| 4485 | new Key<Boolean>("android.led.transmit", boolean.class); |
| 4486 | |
| 4487 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 4488 | * <p>Whether black-level compensation is locked |
Eino-Ville Talvala | 0956af5 | 2013-12-26 13:19:10 -0800 | [diff] [blame] | 4489 | * to its current values, or is free to vary.</p> |
| 4490 | * <p>Whether the black level offset was locked for this frame. Should be |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 4491 | * ON if {@link CaptureRequest#BLACK_LEVEL_LOCK android.blackLevel.lock} was ON in the capture request, unless |
Eino-Ville Talvala | 0956af5 | 2013-12-26 13:19:10 -0800 | [diff] [blame] | 4492 | * a change in other capture settings forced the camera device to |
| 4493 | * perform a black level reset.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 4494 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 4495 | * <p><b>Full capability</b> - |
| 4496 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 4497 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 4498 | * |
| 4499 | * @see CaptureRequest#BLACK_LEVEL_LOCK |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 4500 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 4501 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 4502 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 4503 | public static final Key<Boolean> BLACK_LEVEL_LOCK = |
| 4504 | new Key<Boolean>("android.blackLevel.lock", boolean.class); |
| 4505 | |
Igor Murashkin | 3865a84 | 2014-01-17 18:18:39 -0800 | [diff] [blame] | 4506 | /** |
| 4507 | * <p>The frame number corresponding to the last request |
| 4508 | * with which the output result (metadata + buffers) has been fully |
| 4509 | * synchronized.</p> |
| 4510 | * <p>When a request is submitted to the camera device, there is usually a |
| 4511 | * delay of several frames before the controls get applied. A camera |
| 4512 | * device may either choose to account for this delay by implementing a |
| 4513 | * pipeline and carefully submit well-timed atomic control updates, or |
| 4514 | * it may start streaming control changes that span over several frame |
| 4515 | * boundaries.</p> |
| 4516 | * <p>In the latter case, whenever a request's settings change relative to |
| 4517 | * the previous submitted request, the full set of changes may take |
| 4518 | * multiple frame durations to fully take effect. Some settings may |
| 4519 | * take effect sooner (in less frame durations) than others.</p> |
| 4520 | * <p>While a set of control changes are being propagated, this value |
| 4521 | * will be CONVERGING.</p> |
| 4522 | * <p>Once it is fully known that a set of control changes have been |
| 4523 | * finished propagating, and the resulting updated control settings |
| 4524 | * have been read back by the camera device, this value will be set |
| 4525 | * to a non-negative frame number (corresponding to the request to |
| 4526 | * which the results have synchronized to).</p> |
| 4527 | * <p>Older camera device implementations may not have a way to detect |
| 4528 | * when all camera controls have been applied, and will always set this |
| 4529 | * value to UNKNOWN.</p> |
| 4530 | * <p>FULL capability devices will always have this value set to the |
| 4531 | * frame number of the request corresponding to this result.</p> |
| 4532 | * <p><em>Further details</em>:</p> |
| 4533 | * <ul> |
| 4534 | * <li>Whenever a request differs from the last request, any future |
| 4535 | * results not yet returned may have this value set to CONVERGING (this |
| 4536 | * could include any in-progress captures not yet returned by the camera |
| 4537 | * device, for more details see pipeline considerations below).</li> |
| 4538 | * <li>Submitting a series of multiple requests that differ from the |
| 4539 | * previous request (e.g. r1, r2, r3 s.t. r1 != r2 != r3) |
| 4540 | * moves the new synchronization frame to the last non-repeating |
| 4541 | * request (using the smallest frame number from the contiguous list of |
| 4542 | * repeating requests).</li> |
| 4543 | * <li>Submitting the same request repeatedly will not change this value |
| 4544 | * to CONVERGING, if it was already a non-negative value.</li> |
| 4545 | * <li>When this value changes to non-negative, that means that all of the |
| 4546 | * metadata controls from the request have been applied, all of the |
| 4547 | * metadata controls from the camera device have been read to the |
| 4548 | * updated values (into the result), and all of the graphics buffers |
| 4549 | * corresponding to this result are also synchronized to the request.</li> |
| 4550 | * </ul> |
| 4551 | * <p><em>Pipeline considerations</em>:</p> |
| 4552 | * <p>Submitting a request with updated controls relative to the previously |
| 4553 | * submitted requests may also invalidate the synchronization state |
| 4554 | * of all the results corresponding to currently in-flight requests.</p> |
| 4555 | * <p>In other words, results for this current request and up to |
| 4556 | * {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} prior requests may have their |
| 4557 | * android.sync.frameNumber change to CONVERGING.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 4558 | * <p><b>Possible values:</b> |
| 4559 | * <ul> |
| 4560 | * <li>{@link #SYNC_FRAME_NUMBER_CONVERGING CONVERGING}</li> |
| 4561 | * <li>{@link #SYNC_FRAME_NUMBER_UNKNOWN UNKNOWN}</li> |
| 4562 | * </ul></p> |
| 4563 | * <p><b>Available values for this device:</b><br> |
| 4564 | * Either a non-negative value corresponding to a |
| 4565 | * <code>frame_number</code>, or one of the two enums (CONVERGING / UNKNOWN).</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 4566 | * <p>This key is available on all devices.</p> |
Igor Murashkin | 3865a84 | 2014-01-17 18:18:39 -0800 | [diff] [blame] | 4567 | * |
| 4568 | * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH |
| 4569 | * @see #SYNC_FRAME_NUMBER_CONVERGING |
| 4570 | * @see #SYNC_FRAME_NUMBER_UNKNOWN |
| 4571 | * @hide |
| 4572 | */ |
Mathew Inwood | bcbe440 | 2018-08-08 15:42:59 +0100 | [diff] [blame^] | 4573 | @UnsupportedAppUsage |
Zhijun He | 4f91e2a | 2014-04-17 13:20:21 -0700 | [diff] [blame] | 4574 | public static final Key<Long> SYNC_FRAME_NUMBER = |
| 4575 | new Key<Long>("android.sync.frameNumber", long.class); |
Igor Murashkin | 3865a84 | 2014-01-17 18:18:39 -0800 | [diff] [blame] | 4576 | |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 4577 | /** |
| 4578 | * <p>The amount of exposure time increase factor applied to the original output |
| 4579 | * frame by the application processing before sending for reprocessing.</p> |
| 4580 | * <p>This is optional, and will be supported if the camera device supports YUV_REPROCESSING |
| 4581 | * capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains YUV_REPROCESSING).</p> |
| 4582 | * <p>For some YUV reprocessing use cases, the application may choose to filter the original |
| 4583 | * output frames to effectively reduce the noise to the same level as a frame that was |
| 4584 | * captured with longer exposure time. To be more specific, assuming the original captured |
| 4585 | * images were captured with a sensitivity of S and an exposure time of T, the model in |
| 4586 | * the camera device is that the amount of noise in the image would be approximately what |
| 4587 | * would be expected if the original capture parameters had been a sensitivity of |
| 4588 | * S/effectiveExposureFactor and an exposure time of T*effectiveExposureFactor, rather |
| 4589 | * than S and T respectively. If the captured images were processed by the application |
| 4590 | * before being sent for reprocessing, then the application may have used image processing |
| 4591 | * algorithms and/or multi-frame image fusion to reduce the noise in the |
| 4592 | * application-processed images (input images). By using the effectiveExposureFactor |
| 4593 | * control, the application can communicate to the camera device the actual noise level |
| 4594 | * improvement in the application-processed image. With this information, the camera |
| 4595 | * device can select appropriate noise reduction and edge enhancement parameters to avoid |
| 4596 | * excessive noise reduction ({@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode}) and insufficient edge |
| 4597 | * enhancement ({@link CaptureRequest#EDGE_MODE android.edge.mode}) being applied to the reprocessed frames.</p> |
| 4598 | * <p>For example, for multi-frame image fusion use case, the application may fuse |
| 4599 | * multiple output frames together to a final frame for reprocessing. When N image are |
| 4600 | * fused into 1 image for reprocessing, the exposure time increase factor could be up to |
| 4601 | * square root of N (based on a simple photon shot noise model). The camera device will |
| 4602 | * adjust the reprocessing noise reduction and edge enhancement parameters accordingly to |
| 4603 | * produce the best quality images.</p> |
| 4604 | * <p>This is relative factor, 1.0 indicates the application hasn't processed the input |
| 4605 | * buffer in a way that affects its effective exposure time.</p> |
| 4606 | * <p>This control is only effective for YUV reprocessing capture request. For noise |
| 4607 | * reduction reprocessing, it is only effective when <code>{@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode} != OFF</code>. |
| 4608 | * Similarly, for edge enhancement reprocessing, it is only effective when |
| 4609 | * <code>{@link CaptureRequest#EDGE_MODE android.edge.mode} != OFF</code>.</p> |
| 4610 | * <p><b>Units</b>: Relative exposure time increase factor.</p> |
| 4611 | * <p><b>Range of valid values:</b><br> |
| 4612 | * >= 1.0</p> |
| 4613 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
Zhijun He | 513f7c3 | 2015-04-24 18:23:54 -0700 | [diff] [blame] | 4614 | * <p><b>Limited capability</b> - |
| 4615 | * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the |
| 4616 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 4617 | * |
| 4618 | * @see CaptureRequest#EDGE_MODE |
Zhijun He | 513f7c3 | 2015-04-24 18:23:54 -0700 | [diff] [blame] | 4619 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 4620 | * @see CaptureRequest#NOISE_REDUCTION_MODE |
| 4621 | * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES |
| 4622 | */ |
| 4623 | @PublicKey |
| 4624 | public static final Key<Float> REPROCESS_EFFECTIVE_EXPOSURE_FACTOR = |
| 4625 | new Key<Float>("android.reprocess.effectiveExposureFactor", float.class); |
| 4626 | |
Eino-Ville Talvala | 4167072 | 2018-03-13 19:43:07 -0700 | [diff] [blame] | 4627 | /** |
| 4628 | * <p>Mode of operation for the lens distortion correction block.</p> |
| 4629 | * <p>The lens distortion correction block attempts to improve image quality by fixing |
| 4630 | * radial, tangential, or other geometric aberrations in the camera device's optics. If |
| 4631 | * available, the {@link CameraCharacteristics#LENS_DISTORTION android.lens.distortion} field documents the lens's distortion parameters.</p> |
| 4632 | * <p>OFF means no distortion correction is done.</p> |
| 4633 | * <p>FAST/HIGH_QUALITY both mean camera device determined distortion correction will be |
| 4634 | * applied. HIGH_QUALITY mode indicates that the camera device will use the highest-quality |
| 4635 | * correction algorithms, even if it slows down capture rate. FAST means the camera device |
| 4636 | * will not slow down capture rate when applying correction. FAST may be the same as OFF if |
| 4637 | * any correction at all would slow down capture rate. Every output stream will have a |
| 4638 | * similar amount of enhancement applied.</p> |
| 4639 | * <p>The correction only applies to processed outputs such as YUV, JPEG, or DEPTH16; it is not |
Eino-Ville Talvala | 08bd163 | 2018-08-01 17:23:09 -0700 | [diff] [blame] | 4640 | * applied to any RAW output.</p> |
Yin-Chia Yeh | 6c73e40 | 2018-06-15 15:37:08 -0700 | [diff] [blame] | 4641 | * <p>This control will be on by default on devices that support this control. Applications |
| 4642 | * disabling distortion correction need to pay extra attention with the coordinate system of |
| 4643 | * metering regions, crop region, and face rectangles. When distortion correction is OFF, |
| 4644 | * metadata coordinates follow the coordinate system of |
| 4645 | * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}. When distortion is not OFF, metadata |
Eino-Ville Talvala | 08bd163 | 2018-08-01 17:23:09 -0700 | [diff] [blame] | 4646 | * coordinates follow the coordinate system of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}. The |
| 4647 | * camera device will map these metadata fields to match the corrected image produced by the |
| 4648 | * camera device, for both capture requests and results. However, this mapping is not very |
| 4649 | * precise, since rectangles do not generally map to rectangles when corrected. Only linear |
| 4650 | * scaling between the active array and precorrection active array coordinates is |
| 4651 | * performed. Applications that require precise correction of metadata need to undo that |
| 4652 | * linear scaling, and apply a more complete correction that takes into the account the app's |
| 4653 | * own requirements.</p> |
| 4654 | * <p>The full list of metadata that is affected in this way by distortion correction is:</p> |
| 4655 | * <ul> |
| 4656 | * <li>{@link CaptureRequest#CONTROL_AF_REGIONS android.control.afRegions}</li> |
| 4657 | * <li>{@link CaptureRequest#CONTROL_AE_REGIONS android.control.aeRegions}</li> |
| 4658 | * <li>{@link CaptureRequest#CONTROL_AWB_REGIONS android.control.awbRegions}</li> |
| 4659 | * <li>{@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}</li> |
| 4660 | * <li>{@link CaptureResult#STATISTICS_FACES android.statistics.faces}</li> |
| 4661 | * </ul> |
Eino-Ville Talvala | 4167072 | 2018-03-13 19:43:07 -0700 | [diff] [blame] | 4662 | * <p><b>Possible values:</b> |
| 4663 | * <ul> |
| 4664 | * <li>{@link #DISTORTION_CORRECTION_MODE_OFF OFF}</li> |
| 4665 | * <li>{@link #DISTORTION_CORRECTION_MODE_FAST FAST}</li> |
| 4666 | * <li>{@link #DISTORTION_CORRECTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li> |
| 4667 | * </ul></p> |
| 4668 | * <p><b>Available values for this device:</b><br> |
| 4669 | * {@link CameraCharacteristics#DISTORTION_CORRECTION_AVAILABLE_MODES android.distortionCorrection.availableModes}</p> |
| 4670 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 4671 | * |
Eino-Ville Talvala | 08bd163 | 2018-08-01 17:23:09 -0700 | [diff] [blame] | 4672 | * @see CaptureRequest#CONTROL_AE_REGIONS |
| 4673 | * @see CaptureRequest#CONTROL_AF_REGIONS |
| 4674 | * @see CaptureRequest#CONTROL_AWB_REGIONS |
Eino-Ville Talvala | 4167072 | 2018-03-13 19:43:07 -0700 | [diff] [blame] | 4675 | * @see CameraCharacteristics#DISTORTION_CORRECTION_AVAILABLE_MODES |
| 4676 | * @see CameraCharacteristics#LENS_DISTORTION |
Eino-Ville Talvala | 08bd163 | 2018-08-01 17:23:09 -0700 | [diff] [blame] | 4677 | * @see CaptureRequest#SCALER_CROP_REGION |
Yin-Chia Yeh | 6c73e40 | 2018-06-15 15:37:08 -0700 | [diff] [blame] | 4678 | * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE |
| 4679 | * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE |
Eino-Ville Talvala | 08bd163 | 2018-08-01 17:23:09 -0700 | [diff] [blame] | 4680 | * @see CaptureResult#STATISTICS_FACES |
Eino-Ville Talvala | 4167072 | 2018-03-13 19:43:07 -0700 | [diff] [blame] | 4681 | * @see #DISTORTION_CORRECTION_MODE_OFF |
| 4682 | * @see #DISTORTION_CORRECTION_MODE_FAST |
| 4683 | * @see #DISTORTION_CORRECTION_MODE_HIGH_QUALITY |
| 4684 | */ |
| 4685 | @PublicKey |
| 4686 | public static final Key<Integer> DISTORTION_CORRECTION_MODE = |
| 4687 | new Key<Integer>("android.distortionCorrection.mode", int.class); |
| 4688 | |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 4689 | /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ |
| 4690 | * End generated code |
| 4691 | *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 4692 | |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 4693 | |
| 4694 | |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 4695 | } |