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; |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 21 | import android.hardware.camera2.impl.CameraMetadataNative; |
Igor Murashkin | bdf366c | 2014-07-25 16:54:20 -0700 | [diff] [blame] | 22 | import android.hardware.camera2.impl.CaptureResultExtras; |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 23 | import android.hardware.camera2.impl.PublicKey; |
| 24 | import android.hardware.camera2.impl.SyntheticKey; |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame] | 25 | import android.hardware.camera2.utils.TypeReference; |
| 26 | import android.util.Log; |
Igor Murashkin | 72f9f0a | 2014-05-14 15:46:10 -0700 | [diff] [blame] | 27 | import android.util.Rational; |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 28 | |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame] | 29 | import java.util.List; |
| 30 | |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 31 | /** |
Igor Murashkin | db075af | 2014-05-21 10:07:08 -0700 | [diff] [blame] | 32 | * <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] | 33 | * |
Igor Murashkin | db075af | 2014-05-21 10:07:08 -0700 | [diff] [blame] | 34 | * <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] | 35 | * flash), the processing pipeline, the control algorithms, and the output |
| 36 | * buffers.</p> |
| 37 | * |
| 38 | * <p>CaptureResults are produced by a {@link CameraDevice} after processing a |
| 39 | * {@link CaptureRequest}. All properties listed for capture requests can also |
| 40 | * be queried on the capture result, to determine the final values used for |
| 41 | * capture. The result also includes additional metadata about the state of the |
| 42 | * camera device during the capture.</p> |
| 43 | * |
Igor Murashkin | db075af | 2014-05-21 10:07:08 -0700 | [diff] [blame] | 44 | * <p>Not all properties returned by {@link CameraCharacteristics#getAvailableCaptureResultKeys()} |
| 45 | * are necessarily available. Some results are {@link CaptureResult partial} and will |
| 46 | * not have every key set. Only {@link TotalCaptureResult total} results are guaranteed to have |
| 47 | * every key available that was enabled by the request.</p> |
| 48 | * |
| 49 | * <p>{@link CaptureResult} objects are immutable.</p> |
Ruben Brunk | f967a54 | 2014-04-28 16:31:11 -0700 | [diff] [blame] | 50 | * |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 51 | */ |
Igor Murashkin | db075af | 2014-05-21 10:07:08 -0700 | [diff] [blame] | 52 | public class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> { |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame] | 53 | |
| 54 | private static final String TAG = "CaptureResult"; |
| 55 | private static final boolean VERBOSE = false; |
| 56 | |
| 57 | /** |
| 58 | * A {@code Key} is used to do capture result field lookups with |
| 59 | * {@link CaptureResult#get}. |
| 60 | * |
| 61 | * <p>For example, to get the timestamp corresponding to the exposure of the first row: |
| 62 | * <code><pre> |
| 63 | * long timestamp = captureResult.get(CaptureResult.SENSOR_TIMESTAMP); |
| 64 | * </pre></code> |
| 65 | * </p> |
| 66 | * |
| 67 | * <p>To enumerate over all possible keys for {@link CaptureResult}, see |
| 68 | * {@link CameraCharacteristics#getAvailableCaptureResultKeys}.</p> |
| 69 | * |
| 70 | * @see CaptureResult#get |
| 71 | * @see CameraCharacteristics#getAvailableCaptureResultKeys |
| 72 | */ |
| 73 | public final static class Key<T> { |
| 74 | private final CameraMetadataNative.Key<T> mKey; |
| 75 | |
| 76 | /** |
| 77 | * Visible for testing and vendor extensions only. |
| 78 | * |
| 79 | * @hide |
| 80 | */ |
Emilian Peev | de62d84 | 2017-03-23 19:20:40 +0000 | [diff] [blame^] | 81 | public Key(String name, Class<T> type, long vendorId) { |
| 82 | mKey = new CameraMetadataNative.Key<T>(name, type, vendorId); |
| 83 | } |
| 84 | |
| 85 | /** |
| 86 | * Visible for testing and vendor extensions only. |
| 87 | * |
| 88 | * @hide |
| 89 | */ |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame] | 90 | public Key(String name, Class<T> type) { |
| 91 | mKey = new CameraMetadataNative.Key<T>(name, type); |
| 92 | } |
| 93 | |
| 94 | /** |
| 95 | * Visible for testing and vendor extensions only. |
| 96 | * |
| 97 | * @hide |
| 98 | */ |
| 99 | public Key(String name, TypeReference<T> typeReference) { |
| 100 | mKey = new CameraMetadataNative.Key<T>(name, typeReference); |
| 101 | } |
| 102 | |
| 103 | /** |
| 104 | * Return a camelCase, period separated name formatted like: |
| 105 | * {@code "root.section[.subsections].name"}. |
| 106 | * |
| 107 | * <p>Built-in keys exposed by the Android SDK are always prefixed with {@code "android."}; |
| 108 | * keys that are device/platform-specific are prefixed with {@code "com."}.</p> |
| 109 | * |
| 110 | * <p>For example, {@code CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP} would |
| 111 | * have a name of {@code "android.scaler.streamConfigurationMap"}; whereas a device |
| 112 | * specific key might look like {@code "com.google.nexus.data.private"}.</p> |
| 113 | * |
| 114 | * @return String representation of the key name |
| 115 | */ |
Eino-Ville Talvala | 8b90557 | 2015-05-14 15:43:01 -0700 | [diff] [blame] | 116 | @NonNull |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame] | 117 | public String getName() { |
| 118 | return mKey.getName(); |
| 119 | } |
| 120 | |
| 121 | /** |
Emilian Peev | de62d84 | 2017-03-23 19:20:40 +0000 | [diff] [blame^] | 122 | * Return vendor tag id. |
| 123 | * |
| 124 | * @hide |
| 125 | */ |
| 126 | public long getVendorId() { |
| 127 | return mKey.getVendorId(); |
| 128 | } |
| 129 | |
| 130 | /** |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame] | 131 | * {@inheritDoc} |
| 132 | */ |
| 133 | @Override |
| 134 | public final int hashCode() { |
| 135 | return mKey.hashCode(); |
| 136 | } |
| 137 | |
| 138 | /** |
| 139 | * {@inheritDoc} |
| 140 | */ |
| 141 | @SuppressWarnings("unchecked") |
| 142 | @Override |
| 143 | public final boolean equals(Object o) { |
| 144 | return o instanceof Key && ((Key<T>)o).mKey.equals(mKey); |
| 145 | } |
| 146 | |
| 147 | /** |
Chien-Yu Chen | 12a8385 | 2015-07-07 12:17:22 -0700 | [diff] [blame] | 148 | * Return this {@link Key} as a string representation. |
| 149 | * |
| 150 | * <p>{@code "CaptureResult.Key(%s)"}, where {@code %s} represents |
| 151 | * the name of this key as returned by {@link #getName}.</p> |
| 152 | * |
| 153 | * @return string representation of {@link Key} |
| 154 | */ |
| 155 | @NonNull |
| 156 | @Override |
| 157 | public String toString() { |
| 158 | return String.format("CaptureResult.Key(%s)", mKey.getName()); |
| 159 | } |
| 160 | |
| 161 | /** |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame] | 162 | * Visible for CameraMetadataNative implementation only; do not use. |
| 163 | * |
| 164 | * TODO: Make this private or remove it altogether. |
| 165 | * |
| 166 | * @hide |
| 167 | */ |
| 168 | public CameraMetadataNative.Key<T> getNativeKey() { |
| 169 | return mKey; |
| 170 | } |
| 171 | |
| 172 | @SuppressWarnings({ "unchecked" }) |
| 173 | /*package*/ Key(CameraMetadataNative.Key<?> nativeKey) { |
| 174 | mKey = (CameraMetadataNative.Key<T>) nativeKey; |
| 175 | } |
| 176 | } |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 177 | |
| 178 | private final CameraMetadataNative mResults; |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 179 | private final CaptureRequest mRequest; |
| 180 | private final int mSequenceId; |
Igor Murashkin | bdf366c | 2014-07-25 16:54:20 -0700 | [diff] [blame] | 181 | private final long mFrameNumber; |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 182 | |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 183 | /** |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 184 | * Takes ownership of the passed-in properties object |
Igor Murashkin | bdf366c | 2014-07-25 16:54:20 -0700 | [diff] [blame] | 185 | * |
| 186 | * <p>For internal use only</p> |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 187 | * @hide |
| 188 | */ |
Igor Murashkin | bdf366c | 2014-07-25 16:54:20 -0700 | [diff] [blame] | 189 | public CaptureResult(CameraMetadataNative results, CaptureRequest parent, |
| 190 | CaptureResultExtras extras) { |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 191 | if (results == null) { |
| 192 | throw new IllegalArgumentException("results was null"); |
| 193 | } |
| 194 | |
| 195 | if (parent == null) { |
| 196 | throw new IllegalArgumentException("parent was null"); |
| 197 | } |
| 198 | |
Igor Murashkin | bdf366c | 2014-07-25 16:54:20 -0700 | [diff] [blame] | 199 | if (extras == null) { |
| 200 | throw new IllegalArgumentException("extras was null"); |
| 201 | } |
| 202 | |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame] | 203 | mResults = CameraMetadataNative.move(results); |
| 204 | if (mResults.isEmpty()) { |
| 205 | throw new AssertionError("Results must not be empty"); |
| 206 | } |
Emilian Peev | de62d84 | 2017-03-23 19:20:40 +0000 | [diff] [blame^] | 207 | setNativeInstance(mResults); |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 208 | mRequest = parent; |
Igor Murashkin | bdf366c | 2014-07-25 16:54:20 -0700 | [diff] [blame] | 209 | mSequenceId = extras.getRequestId(); |
| 210 | mFrameNumber = extras.getFrameNumber(); |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 211 | } |
| 212 | |
Ruben Brunk | f967a54 | 2014-04-28 16:31:11 -0700 | [diff] [blame] | 213 | /** |
| 214 | * Returns a copy of the underlying {@link CameraMetadataNative}. |
| 215 | * @hide |
| 216 | */ |
| 217 | public CameraMetadataNative getNativeCopy() { |
| 218 | return new CameraMetadataNative(mResults); |
| 219 | } |
| 220 | |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame] | 221 | /** |
| 222 | * Creates a request-less result. |
| 223 | * |
| 224 | * <p><strong>For testing only.</strong></p> |
| 225 | * @hide |
| 226 | */ |
| 227 | public CaptureResult(CameraMetadataNative results, int sequenceId) { |
| 228 | if (results == null) { |
| 229 | throw new IllegalArgumentException("results was null"); |
| 230 | } |
| 231 | |
| 232 | mResults = CameraMetadataNative.move(results); |
| 233 | if (mResults.isEmpty()) { |
| 234 | throw new AssertionError("Results must not be empty"); |
| 235 | } |
| 236 | |
Emilian Peev | de62d84 | 2017-03-23 19:20:40 +0000 | [diff] [blame^] | 237 | setNativeInstance(mResults); |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame] | 238 | mRequest = null; |
| 239 | mSequenceId = sequenceId; |
Igor Murashkin | bdf366c | 2014-07-25 16:54:20 -0700 | [diff] [blame] | 240 | mFrameNumber = -1; |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame] | 241 | } |
| 242 | |
| 243 | /** |
| 244 | * Get a capture result field value. |
| 245 | * |
| 246 | * <p>The field definitions can be found in {@link CaptureResult}.</p> |
| 247 | * |
| 248 | * <p>Querying the value for the same key more than once will return a value |
| 249 | * which is equal to the previous queried value.</p> |
| 250 | * |
| 251 | * @throws IllegalArgumentException if the key was not valid |
| 252 | * |
| 253 | * @param key The result field to read. |
| 254 | * @return The value of that key, or {@code null} if the field is not set. |
| 255 | */ |
Eino-Ville Talvala | 8b90557 | 2015-05-14 15:43:01 -0700 | [diff] [blame] | 256 | @Nullable |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 257 | public <T> T get(Key<T> key) { |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame] | 258 | T value = mResults.get(key); |
| 259 | if (VERBOSE) Log.v(TAG, "#get for Key = " + key.getName() + ", returned value = " + value); |
| 260 | return value; |
| 261 | } |
| 262 | |
| 263 | /** |
| 264 | * {@inheritDoc} |
| 265 | * @hide |
| 266 | */ |
| 267 | @SuppressWarnings("unchecked") |
| 268 | @Override |
| 269 | protected <T> T getProtected(Key<?> key) { |
| 270 | return (T) mResults.get(key); |
| 271 | } |
| 272 | |
| 273 | /** |
| 274 | * {@inheritDoc} |
| 275 | * @hide |
| 276 | */ |
| 277 | @SuppressWarnings("unchecked") |
| 278 | @Override |
| 279 | protected Class<Key<?>> getKeyClass() { |
| 280 | Object thisClass = Key.class; |
| 281 | return (Class<Key<?>>)thisClass; |
| 282 | } |
| 283 | |
| 284 | /** |
| 285 | * Dumps the native metadata contents to logcat. |
| 286 | * |
| 287 | * <p>Visibility for testing/debugging only. The results will not |
| 288 | * include any synthesized keys, as they are invisible to the native layer.</p> |
| 289 | * |
| 290 | * @hide |
| 291 | */ |
| 292 | public void dumpToLog() { |
| 293 | mResults.dumpToLog(); |
| 294 | } |
| 295 | |
| 296 | /** |
| 297 | * {@inheritDoc} |
| 298 | */ |
| 299 | @Override |
Eino-Ville Talvala | 8b90557 | 2015-05-14 15:43:01 -0700 | [diff] [blame] | 300 | @NonNull |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame] | 301 | public List<Key<?>> getKeys() { |
| 302 | // Force the javadoc for this function to show up on the CaptureResult page |
| 303 | return super.getKeys(); |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 304 | } |
| 305 | |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 306 | /** |
| 307 | * Get the request associated with this result. |
| 308 | * |
Igor Murashkin | db075af | 2014-05-21 10:07:08 -0700 | [diff] [blame] | 309 | * <p>Whenever a request has been fully or partially captured, with |
Eino-Ville Talvala | fd88743 | 2014-09-04 13:07:40 -0700 | [diff] [blame] | 310 | * {@link CameraCaptureSession.CaptureCallback#onCaptureCompleted} or |
| 311 | * {@link CameraCaptureSession.CaptureCallback#onCaptureProgressed}, the {@code result}'s |
Igor Murashkin | db075af | 2014-05-21 10:07:08 -0700 | [diff] [blame] | 312 | * {@code getRequest()} will return that {@code request}. |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 313 | * </p> |
| 314 | * |
Igor Murashkin | db075af | 2014-05-21 10:07:08 -0700 | [diff] [blame] | 315 | * <p>For example, |
Eino-Ville Talvala | fd88743 | 2014-09-04 13:07:40 -0700 | [diff] [blame] | 316 | * <code><pre>cameraDevice.capture(someRequest, new CaptureCallback() { |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 317 | * {@literal @}Override |
| 318 | * void onCaptureCompleted(CaptureRequest myRequest, CaptureResult myResult) { |
| 319 | * assert(myResult.getRequest.equals(myRequest) == true); |
| 320 | * } |
Igor Murashkin | db075af | 2014-05-21 10:07:08 -0700 | [diff] [blame] | 321 | * }, null); |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 322 | * </code></pre> |
| 323 | * </p> |
| 324 | * |
| 325 | * @return The request associated with this result. Never {@code null}. |
| 326 | */ |
Eino-Ville Talvala | 8b90557 | 2015-05-14 15:43:01 -0700 | [diff] [blame] | 327 | @NonNull |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 328 | public CaptureRequest getRequest() { |
| 329 | return mRequest; |
| 330 | } |
| 331 | |
| 332 | /** |
| 333 | * Get the frame number associated with this result. |
| 334 | * |
| 335 | * <p>Whenever a request has been processed, regardless of failure or success, |
| 336 | * it gets a unique frame number assigned to its future result/failure.</p> |
| 337 | * |
Chien-Yu Chen | 5398a67 | 2015-03-19 14:48:43 -0700 | [diff] [blame] | 338 | * <p>For the same type of request (capturing from the camera device or reprocessing), this |
| 339 | * value monotonically increments, starting with 0, for every new result or failure and the |
| 340 | * scope is the lifetime of the {@link CameraDevice}. Between different types of requests, |
| 341 | * the frame number may not monotonically increment. For example, the frame number of a newer |
| 342 | * reprocess result may be smaller than the frame number of an older result of capturing new |
| 343 | * images from the camera device, but the frame number of a newer reprocess result will never be |
| 344 | * smaller than the frame number of an older reprocess result.</p> |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 345 | * |
Igor Murashkin | bdf366c | 2014-07-25 16:54:20 -0700 | [diff] [blame] | 346 | * @return The frame number |
Chien-Yu Chen | 5398a67 | 2015-03-19 14:48:43 -0700 | [diff] [blame] | 347 | * |
| 348 | * @see CameraDevice#createCaptureRequest |
| 349 | * @see CameraDevice#createReprocessCaptureRequest |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 350 | */ |
Igor Murashkin | bdf366c | 2014-07-25 16:54:20 -0700 | [diff] [blame] | 351 | public long getFrameNumber() { |
| 352 | return mFrameNumber; |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 353 | } |
| 354 | |
| 355 | /** |
| 356 | * The sequence ID for this failure that was returned by the |
Eino-Ville Talvala | 0a160ac | 2014-07-02 14:29:26 -0700 | [diff] [blame] | 357 | * {@link CameraCaptureSession#capture} family of functions. |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 358 | * |
| 359 | * <p>The sequence ID is a unique monotonically increasing value starting from 0, |
| 360 | * incremented every time a new group of requests is submitted to the CameraDevice.</p> |
| 361 | * |
| 362 | * @return int The ID for the sequence of requests that this capture result is a part of |
| 363 | * |
Eino-Ville Talvala | fd88743 | 2014-09-04 13:07:40 -0700 | [diff] [blame] | 364 | * @see CameraDevice.CaptureCallback#onCaptureSequenceCompleted |
| 365 | * @see CameraDevice.CaptureCallback#onCaptureSequenceAborted |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 366 | */ |
| 367 | public int getSequenceId() { |
| 368 | return mSequenceId; |
| 369 | } |
| 370 | |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 371 | /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ |
| 372 | * The key entries below this point are generated from metadata |
| 373 | * definitions in /system/media/camera/docs. Do not modify by hand or |
| 374 | * modify the comment blocks at the start or end. |
| 375 | *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/ |
| 376 | |
| 377 | /** |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 378 | * <p>The mode control selects how the image data is converted from the |
| 379 | * sensor's native color into linear sRGB color.</p> |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 380 | * <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] | 381 | * control is overridden by the AWB routine. When AWB is disabled, the |
| 382 | * application controls how the color mapping is performed.</p> |
| 383 | * <p>We define the expected processing pipeline below. For consistency |
| 384 | * across devices, this is always the case with TRANSFORM_MATRIX.</p> |
| 385 | * <p>When either FULL or HIGH_QUALITY is used, the camera device may |
| 386 | * do additional processing but {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and |
| 387 | * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} will still be provided by the |
| 388 | * camera device (in the results) and be roughly correct.</p> |
| 389 | * <p>Switching to TRANSFORM_MATRIX and using the data provided from |
| 390 | * FAST or HIGH_QUALITY will yield a picture with the same white point |
| 391 | * as what was produced by the camera device in the earlier frame.</p> |
| 392 | * <p>The expected processing pipeline is as follows:</p> |
| 393 | * <p><img alt="White balance processing pipeline" src="../../../../images/camera2/metadata/android.colorCorrection.mode/processing_pipeline.png" /></p> |
| 394 | * <p>The white balance is encoded by two values, a 4-channel white-balance |
| 395 | * gain vector (applied in the Bayer domain), and a 3x3 color transform |
| 396 | * matrix (applied after demosaic).</p> |
| 397 | * <p>The 4-channel white-balance gains are defined as:</p> |
| 398 | * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} = [ R G_even G_odd B ] |
| 399 | * </code></pre> |
| 400 | * <p>where <code>G_even</code> is the gain for green pixels on even rows of the |
| 401 | * output, and <code>G_odd</code> is the gain for green pixels on the odd rows. |
| 402 | * These may be identical for a given camera device implementation; if |
| 403 | * the camera device does not support a separate gain for even/odd green |
| 404 | * channels, it will use the <code>G_even</code> value, and write <code>G_odd</code> equal to |
| 405 | * <code>G_even</code> in the output result metadata.</p> |
| 406 | * <p>The matrices for color transforms are defined as a 9-entry vector:</p> |
| 407 | * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} = [ I0 I1 I2 I3 I4 I5 I6 I7 I8 ] |
| 408 | * </code></pre> |
| 409 | * <p>which define a transform from input sensor colors, <code>P_in = [ r g b ]</code>, |
| 410 | * to output linear sRGB, <code>P_out = [ r' g' b' ]</code>,</p> |
| 411 | * <p>with colors as follows:</p> |
| 412 | * <pre><code>r' = I0r + I1g + I2b |
| 413 | * g' = I3r + I4g + I5b |
| 414 | * b' = I6r + I7g + I8b |
| 415 | * </code></pre> |
| 416 | * <p>Both the input and output value ranges must match. Overflow/underflow |
| 417 | * values are clipped to fit within the range.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 418 | * <p><b>Possible values:</b> |
| 419 | * <ul> |
| 420 | * <li>{@link #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX TRANSFORM_MATRIX}</li> |
| 421 | * <li>{@link #COLOR_CORRECTION_MODE_FAST FAST}</li> |
| 422 | * <li>{@link #COLOR_CORRECTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li> |
| 423 | * </ul></p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 424 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 425 | * <p><b>Full capability</b> - |
| 426 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 427 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 428 | * |
| 429 | * @see CaptureRequest#COLOR_CORRECTION_GAINS |
| 430 | * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM |
| 431 | * @see CaptureRequest#CONTROL_AWB_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 432 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 433 | * @see #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX |
| 434 | * @see #COLOR_CORRECTION_MODE_FAST |
| 435 | * @see #COLOR_CORRECTION_MODE_HIGH_QUALITY |
| 436 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 437 | @PublicKey |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 438 | public static final Key<Integer> COLOR_CORRECTION_MODE = |
| 439 | new Key<Integer>("android.colorCorrection.mode", int.class); |
| 440 | |
| 441 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 442 | * <p>A color transform matrix to use to transform |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 443 | * from sensor RGB color space to output linear sRGB color space.</p> |
Zhijun He | 49a3ca9 | 2014-02-05 13:48:09 -0800 | [diff] [blame] | 444 | * <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] | 445 | * {@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] | 446 | * directly by the application in the request when the |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 447 | * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p> |
Zhijun He | 49a3ca9 | 2014-02-05 13:48:09 -0800 | [diff] [blame] | 448 | * <p>In the latter case, the camera device may round the matrix to account |
| 449 | * for precision issues; the final rounded matrix should be reported back |
| 450 | * in this matrix result metadata. The transform should keep the magnitude |
| 451 | * of the output color values within <code>[0, 1.0]</code> (assuming input color |
| 452 | * 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] | 453 | * <p>The valid range of each matrix element varies on different devices, but |
| 454 | * 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] | 455 | * <p><b>Units</b>: Unitless scale factors</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 456 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 457 | * <p><b>Full capability</b> - |
| 458 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 459 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 460 | * |
| 461 | * @see CaptureRequest#COLOR_CORRECTION_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 462 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 463 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 464 | @PublicKey |
Eino-Ville Talvala | 2bb91a7 | 2014-05-27 18:16:53 -0700 | [diff] [blame] | 465 | public static final Key<android.hardware.camera2.params.ColorSpaceTransform> COLOR_CORRECTION_TRANSFORM = |
| 466 | 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] | 467 | |
| 468 | /** |
Igor Murashkin | 7d2a5c5 | 2014-01-17 15:07:52 -0800 | [diff] [blame] | 469 | * <p>Gains applying to Bayer raw color channels for |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 470 | * white-balance.</p> |
Eino-Ville Talvala | 2bb91a7 | 2014-05-27 18:16:53 -0700 | [diff] [blame] | 471 | * <p>These per-channel gains are either set by the camera device |
| 472 | * when the request {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not |
| 473 | * TRANSFORM_MATRIX, or directly by the application in the |
| 474 | * request when the {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is |
| 475 | * TRANSFORM_MATRIX.</p> |
| 476 | * <p>The gains in the result metadata are the gains actually |
| 477 | * applied by the camera device to the current frame.</p> |
Yin-Chia Yeh | d9fc67c | 2015-01-30 10:47:22 -0800 | [diff] [blame] | 478 | * <p>The valid range of gains varies on different devices, but gains |
| 479 | * between [1.0, 3.0] are guaranteed not to be clipped. Even if a given |
| 480 | * device allows gains below 1.0, this is usually not recommended because |
| 481 | * this can create color artifacts.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 482 | * <p><b>Units</b>: Unitless gain factors</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 483 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 484 | * <p><b>Full capability</b> - |
| 485 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 486 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 487 | * |
| 488 | * @see CaptureRequest#COLOR_CORRECTION_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 489 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 490 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 491 | @PublicKey |
Eino-Ville Talvala | 2bb91a7 | 2014-05-27 18:16:53 -0700 | [diff] [blame] | 492 | public static final Key<android.hardware.camera2.params.RggbChannelVector> COLOR_CORRECTION_GAINS = |
| 493 | 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] | 494 | |
| 495 | /** |
Zhijun He | a05e59d | 2014-07-08 18:27:47 -0700 | [diff] [blame] | 496 | * <p>Mode of operation for the chromatic aberration correction algorithm.</p> |
Zhijun He | a05e59d | 2014-07-08 18:27:47 -0700 | [diff] [blame] | 497 | * <p>Chromatic (color) aberration is caused by the fact that different wavelengths of light |
| 498 | * can not focus on the same point after exiting from the lens. This metadata defines |
| 499 | * the high level control of chromatic aberration correction algorithm, which aims to |
| 500 | * minimize the chromatic artifacts that may occur along the object boundaries in an |
| 501 | * image.</p> |
| 502 | * <p>FAST/HIGH_QUALITY both mean that camera device determined aberration |
| 503 | * correction will be applied. HIGH_QUALITY mode indicates that the camera device will |
| 504 | * use the highest-quality aberration correction algorithms, even if it slows down |
| 505 | * capture rate. FAST means the camera device will not slow down capture rate when |
| 506 | * applying aberration correction.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 507 | * <p>LEGACY devices will always be in FAST mode.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 508 | * <p><b>Possible values:</b> |
| 509 | * <ul> |
| 510 | * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_OFF OFF}</li> |
| 511 | * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_FAST FAST}</li> |
| 512 | * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY HIGH_QUALITY}</li> |
| 513 | * </ul></p> |
| 514 | * <p><b>Available values for this device:</b><br> |
| 515 | * {@link CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES android.colorCorrection.availableAberrationModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 516 | * <p>This key is available on all devices.</p> |
Zhijun He | a05e59d | 2014-07-08 18:27:47 -0700 | [diff] [blame] | 517 | * |
Zhijun He | 9e4e439 | 2014-08-18 11:12:32 -0700 | [diff] [blame] | 518 | * @see CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES |
| 519 | * @see #COLOR_CORRECTION_ABERRATION_MODE_OFF |
| 520 | * @see #COLOR_CORRECTION_ABERRATION_MODE_FAST |
| 521 | * @see #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY |
Zhijun He | a05e59d | 2014-07-08 18:27:47 -0700 | [diff] [blame] | 522 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 523 | @PublicKey |
Zhijun He | 9e4e439 | 2014-08-18 11:12:32 -0700 | [diff] [blame] | 524 | public static final Key<Integer> COLOR_CORRECTION_ABERRATION_MODE = |
| 525 | new Key<Integer>("android.colorCorrection.aberrationMode", int.class); |
Zhijun He | a05e59d | 2014-07-08 18:27:47 -0700 | [diff] [blame] | 526 | |
| 527 | /** |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 528 | * <p>The desired setting for the camera device's auto-exposure |
| 529 | * algorithm's antibanding compensation.</p> |
| 530 | * <p>Some kinds of lighting fixtures, such as some fluorescent |
| 531 | * lights, flicker at the rate of the power supply frequency |
| 532 | * (60Hz or 50Hz, depending on country). While this is |
| 533 | * typically not noticeable to a person, it can be visible to |
| 534 | * a camera device. If a camera sets its exposure time to the |
| 535 | * wrong value, the flicker may become visible in the |
| 536 | * viewfinder as flicker or in a final captured image, as a |
| 537 | * set of variable-brightness bands across the image.</p> |
| 538 | * <p>Therefore, the auto-exposure routines of camera devices |
| 539 | * include antibanding routines that ensure that the chosen |
| 540 | * exposure value will not cause such banding. The choice of |
| 541 | * exposure time depends on the rate of flicker, which the |
| 542 | * camera device can detect automatically, or the expected |
| 543 | * rate can be selected by the application using this |
| 544 | * control.</p> |
| 545 | * <p>A given camera device may not support all of the possible |
| 546 | * options for the antibanding mode. The |
| 547 | * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes} key contains |
| 548 | * the available modes for a given camera device.</p> |
Yin-Chia Yeh | 7b2cae6 | 2014-11-25 11:54:18 -0800 | [diff] [blame] | 549 | * <p>AUTO mode is the default if it is available on given |
| 550 | * camera device. When AUTO mode is not available, the |
| 551 | * default will be either 50HZ or 60HZ, and both 50HZ |
| 552 | * and 60HZ will be available.</p> |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 553 | * <p>If manual exposure control is enabled (by setting |
| 554 | * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} to OFF), |
| 555 | * then this setting has no effect, and the application must |
| 556 | * ensure it selects exposure times that do not cause banding |
| 557 | * issues. The {@link CaptureResult#STATISTICS_SCENE_FLICKER android.statistics.sceneFlicker} key can assist |
| 558 | * the application in this.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 559 | * <p><b>Possible values:</b> |
| 560 | * <ul> |
| 561 | * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_OFF OFF}</li> |
| 562 | * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_50HZ 50HZ}</li> |
| 563 | * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_60HZ 60HZ}</li> |
| 564 | * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_AUTO AUTO}</li> |
| 565 | * </ul></p> |
| 566 | * <p><b>Available values for this device:</b><br></p> |
| 567 | * <p>{@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 568 | * <p>This key is available on all devices.</p> |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 569 | * |
| 570 | * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES |
| 571 | * @see CaptureRequest#CONTROL_AE_MODE |
| 572 | * @see CaptureRequest#CONTROL_MODE |
| 573 | * @see CaptureResult#STATISTICS_SCENE_FLICKER |
| 574 | * @see #CONTROL_AE_ANTIBANDING_MODE_OFF |
| 575 | * @see #CONTROL_AE_ANTIBANDING_MODE_50HZ |
| 576 | * @see #CONTROL_AE_ANTIBANDING_MODE_60HZ |
| 577 | * @see #CONTROL_AE_ANTIBANDING_MODE_AUTO |
| 578 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 579 | @PublicKey |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 580 | public static final Key<Integer> CONTROL_AE_ANTIBANDING_MODE = |
| 581 | new Key<Integer>("android.control.aeAntibandingMode", int.class); |
| 582 | |
| 583 | /** |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 584 | * <p>Adjustment to auto-exposure (AE) target image |
| 585 | * brightness.</p> |
| 586 | * <p>The adjustment is measured as a count of steps, with the |
| 587 | * step size defined by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep} and the |
| 588 | * allowed range by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}.</p> |
| 589 | * <p>For example, if the exposure value (EV) step is 0.333, '6' |
| 590 | * will mean an exposure compensation of +2 EV; -3 will mean an |
| 591 | * exposure compensation of -1 EV. One EV represents a doubling |
| 592 | * of image brightness. Note that this control will only be |
| 593 | * effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF. This control |
| 594 | * 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] | 595 | * <p>In the event of exposure compensation value being changed, camera device |
| 596 | * may take several frames to reach the newly requested exposure target. |
| 597 | * During that time, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} field will be in the SEARCHING |
| 598 | * state. Once the new exposure target is reached, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} will |
| 599 | * change from SEARCHING to either CONVERGED, LOCKED (if AE lock is enabled), or |
| 600 | * 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] | 601 | * <p><b>Units</b>: Compensation steps</p> |
| 602 | * <p><b>Range of valid values:</b><br> |
| 603 | * {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 604 | * <p>This key is available on all devices.</p> |
Yin-Chia Yeh | a4227df | 2014-05-05 14:27:39 -0700 | [diff] [blame] | 605 | * |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 606 | * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE |
| 607 | * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP |
Yin-Chia Yeh | a4227df | 2014-05-05 14:27:39 -0700 | [diff] [blame] | 608 | * @see CaptureRequest#CONTROL_AE_LOCK |
| 609 | * @see CaptureRequest#CONTROL_AE_MODE |
| 610 | * @see CaptureResult#CONTROL_AE_STATE |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 611 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 612 | @PublicKey |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 613 | public static final Key<Integer> CONTROL_AE_EXPOSURE_COMPENSATION = |
| 614 | new Key<Integer>("android.control.aeExposureCompensation", int.class); |
| 615 | |
| 616 | /** |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 617 | * <p>Whether auto-exposure (AE) is currently locked to its latest |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 618 | * calculated values.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 619 | * <p>When set to <code>true</code> (ON), the AE algorithm is locked to its latest parameters, |
| 620 | * and will not change exposure settings until the lock is set to <code>false</code> (OFF).</p> |
| 621 | * <p>Note that even when AE is locked, the flash may be fired if |
| 622 | * the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_AUTO_FLASH / |
| 623 | * ON_ALWAYS_FLASH / ON_AUTO_FLASH_REDEYE.</p> |
Yin-Chia Yeh | a4227df | 2014-05-05 14:27:39 -0700 | [diff] [blame] | 624 | * <p>When {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation} is changed, even if the AE lock |
| 625 | * is ON, the camera device will still adjust its exposure value.</p> |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 626 | * <p>If AE precapture is triggered (see {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}) |
| 627 | * when AE is already locked, the camera device will not change the exposure time |
| 628 | * ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}) and sensitivity ({@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}) |
| 629 | * parameters. The flash may be fired if the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} |
| 630 | * 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] | 631 | * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_ALWAYS_FLASH, the scene may become overexposed. |
| 632 | * Similarly, AE precapture trigger CANCEL has no effect when AE is already locked.</p> |
| 633 | * <p>When an AE precapture sequence is triggered, AE unlock will not be able to unlock |
| 634 | * the AE if AE is locked by the camera device internally during precapture metering |
| 635 | * sequence In other words, submitting requests with AE unlock has no effect for an |
| 636 | * ongoing precapture metering sequence. Otherwise, the precapture metering sequence |
| 637 | * will never succeed in a sequence of preview requests where AE lock is always set |
| 638 | * to <code>false</code>.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 639 | * <p>Since the camera device has a pipeline of in-flight requests, the settings that |
| 640 | * get locked do not necessarily correspond to the settings that were present in the |
| 641 | * latest capture result received from the camera device, since additional captures |
| 642 | * and AE updates may have occurred even before the result was sent out. If an |
| 643 | * application is switching between automatic and manual control and wishes to eliminate |
| 644 | * any flicker during the switch, the following procedure is recommended:</p> |
| 645 | * <ol> |
| 646 | * <li>Starting in auto-AE mode:</li> |
| 647 | * <li>Lock AE</li> |
| 648 | * <li>Wait for the first result to be output that has the AE locked</li> |
| 649 | * <li>Copy exposure settings from that result into a request, set the request to manual AE</li> |
| 650 | * <li>Submit the capture request, proceed to run manual AE as desired.</li> |
| 651 | * </ol> |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 652 | * <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] | 653 | * <p>This key is available on all devices.</p> |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 654 | * |
Yin-Chia Yeh | a4227df | 2014-05-05 14:27:39 -0700 | [diff] [blame] | 655 | * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 656 | * @see CaptureRequest#CONTROL_AE_MODE |
| 657 | * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER |
| 658 | * @see CaptureResult#CONTROL_AE_STATE |
| 659 | * @see CaptureRequest#SENSOR_EXPOSURE_TIME |
| 660 | * @see CaptureRequest#SENSOR_SENSITIVITY |
| 661 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 662 | @PublicKey |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 663 | public static final Key<Boolean> CONTROL_AE_LOCK = |
| 664 | new Key<Boolean>("android.control.aeLock", boolean.class); |
| 665 | |
| 666 | /** |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 667 | * <p>The desired mode for the camera device's |
| 668 | * auto-exposure routine.</p> |
| 669 | * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is |
| 670 | * AUTO.</p> |
| 671 | * <p>When set to any of the ON modes, the camera device's |
| 672 | * auto-exposure routine is enabled, overriding the |
| 673 | * application's selected exposure time, sensor sensitivity, |
| 674 | * and frame duration ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}, |
| 675 | * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and |
| 676 | * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}). If one of the FLASH modes |
| 677 | * is selected, the camera device's flash unit controls are |
| 678 | * also overridden.</p> |
| 679 | * <p>The FLASH modes are only available if the camera device |
| 680 | * has a flash unit ({@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} is <code>true</code>).</p> |
| 681 | * <p>If flash TORCH mode is desired, this field must be set to |
| 682 | * ON or OFF, and {@link CaptureRequest#FLASH_MODE android.flash.mode} set to TORCH.</p> |
| 683 | * <p>When set to any of the ON modes, the values chosen by the |
| 684 | * camera device auto-exposure routine for the overridden |
| 685 | * fields for a given capture will be available in its |
| 686 | * CaptureResult.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 687 | * <p><b>Possible values:</b> |
| 688 | * <ul> |
| 689 | * <li>{@link #CONTROL_AE_MODE_OFF OFF}</li> |
| 690 | * <li>{@link #CONTROL_AE_MODE_ON ON}</li> |
| 691 | * <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH ON_AUTO_FLASH}</li> |
| 692 | * <li>{@link #CONTROL_AE_MODE_ON_ALWAYS_FLASH ON_ALWAYS_FLASH}</li> |
| 693 | * <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE ON_AUTO_FLASH_REDEYE}</li> |
| 694 | * </ul></p> |
| 695 | * <p><b>Available values for this device:</b><br> |
| 696 | * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES android.control.aeAvailableModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 697 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 698 | * |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 699 | * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 700 | * @see CaptureRequest#CONTROL_MODE |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 701 | * @see CameraCharacteristics#FLASH_INFO_AVAILABLE |
| 702 | * @see CaptureRequest#FLASH_MODE |
Igor Murashkin | aef3b7e | 2014-01-15 13:20:37 -0800 | [diff] [blame] | 703 | * @see CaptureRequest#SENSOR_EXPOSURE_TIME |
| 704 | * @see CaptureRequest#SENSOR_FRAME_DURATION |
Zhijun He | 399f05d | 2014-01-15 11:31:30 -0800 | [diff] [blame] | 705 | * @see CaptureRequest#SENSOR_SENSITIVITY |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 706 | * @see #CONTROL_AE_MODE_OFF |
| 707 | * @see #CONTROL_AE_MODE_ON |
| 708 | * @see #CONTROL_AE_MODE_ON_AUTO_FLASH |
| 709 | * @see #CONTROL_AE_MODE_ON_ALWAYS_FLASH |
| 710 | * @see #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE |
| 711 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 712 | @PublicKey |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 713 | public static final Key<Integer> CONTROL_AE_MODE = |
| 714 | new Key<Integer>("android.control.aeMode", int.class); |
| 715 | |
| 716 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 717 | * <p>List of metering areas to use for auto-exposure adjustment.</p> |
| 718 | * <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] | 719 | * Otherwise will always be present.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 720 | * <p>The maximum number of regions supported by the device is determined by the value |
| 721 | * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe}.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 722 | * <p>The coordinate system is based on the active pixel array, |
Timothy Knight | 2629f27 | 2013-09-03 17:23:23 -0700 | [diff] [blame] | 723 | * with (0,0) being the top-left pixel in the active pixel array, and |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 724 | * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1, |
| 725 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the |
Yin-Chia Yeh | 97f1c85 | 2014-05-28 16:36:05 -0700 | [diff] [blame] | 726 | * bottom-right pixel in the active pixel array.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 727 | * <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] | 728 | * for every pixel in the area. This means that a large metering area |
| 729 | * with the same weight as a smaller area will have more effect in |
| 730 | * the metering result. Metering areas can partially overlap and the |
| 731 | * camera device will add the weights in the overlap region.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 732 | * <p>The weights are relative to weights of other exposure metering regions, so if only one |
| 733 | * region is used, all non-zero weights will have the same effect. A region with 0 |
| 734 | * weight is ignored.</p> |
| 735 | * <p>If all regions have 0 weight, then no specific metering area needs to be used by the |
| 736 | * camera device.</p> |
| 737 | * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in |
| 738 | * capture result metadata, the camera device will ignore the sections outside the crop |
| 739 | * region and output only the intersection rectangle as the metering region in the result |
| 740 | * metadata. If the region is entirely outside the crop region, it will be ignored and |
| 741 | * not reported in the result metadata.</p> |
| 742 | * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p> |
| 743 | * <p><b>Range of valid values:</b><br> |
| 744 | * Coordinates must be between <code>[(0,0), (width, height))</code> of |
| 745 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p> |
Yin-Chia Yeh | 808150f | 2014-09-08 15:48:47 -0700 | [diff] [blame] | 746 | * <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] | 747 | * |
Yin-Chia Yeh | 808150f | 2014-09-08 15:48:47 -0700 | [diff] [blame] | 748 | * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AE |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 749 | * @see CaptureRequest#SCALER_CROP_REGION |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 750 | * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 751 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 752 | @PublicKey |
Yin-Chia Yeh | 817f893 | 2014-05-19 10:23:27 -0700 | [diff] [blame] | 753 | public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AE_REGIONS = |
| 754 | 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] | 755 | |
| 756 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 757 | * <p>Range over which the auto-exposure routine can |
| 758 | * adjust the capture frame rate to maintain good |
| 759 | * exposure.</p> |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 760 | * <p>Only constrains auto-exposure (AE) algorithm, not |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 761 | * manual control of {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime} and |
| 762 | * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}.</p> |
| 763 | * <p><b>Units</b>: Frames per second (FPS)</p> |
| 764 | * <p><b>Range of valid values:</b><br> |
| 765 | * Any of the entries in {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES android.control.aeAvailableTargetFpsRanges}</p> |
| 766 | * <p>This key is available on all devices.</p> |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 767 | * |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 768 | * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 769 | * @see CaptureRequest#SENSOR_EXPOSURE_TIME |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 770 | * @see CaptureRequest#SENSOR_FRAME_DURATION |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 771 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 772 | @PublicKey |
Igor Murashkin | 78712a8 | 2014-05-27 18:32:18 -0700 | [diff] [blame] | 773 | public static final Key<android.util.Range<Integer>> CONTROL_AE_TARGET_FPS_RANGE = |
| 774 | 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] | 775 | |
| 776 | /** |
| 777 | * <p>Whether the camera device will trigger a precapture |
| 778 | * metering sequence when it processes this request.</p> |
| 779 | * <p>This entry is normally set to IDLE, or is not |
| 780 | * included at all in the request settings. When included and |
Zhijun He | dd72be5 | 2015-02-06 13:49:51 -0800 | [diff] [blame] | 781 | * set to START, the camera device will trigger the auto-exposure (AE) |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 782 | * precapture metering sequence.</p> |
Zhijun He | fa95b04 | 2015-02-09 10:40:49 -0800 | [diff] [blame] | 783 | * <p>When set to CANCEL, the camera device will cancel any active |
| 784 | * precapture metering trigger, and return to its initial AE state. |
| 785 | * If a precapture metering sequence is already completed, and the camera |
| 786 | * device has implicitly locked the AE for subsequent still capture, the |
| 787 | * 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] | 788 | * <p>The precapture sequence should be triggered before starting a |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 789 | * high-quality still capture for final metering decisions to |
| 790 | * be made, and for firing pre-capture flash pulses to estimate |
| 791 | * scene brightness and required final capture flash power, when |
| 792 | * the flash is enabled.</p> |
| 793 | * <p>Normally, this entry should be set to START for only a |
| 794 | * single request, and the application should wait until the |
| 795 | * sequence completes before starting a new one.</p> |
Zhijun He | dd72be5 | 2015-02-06 13:49:51 -0800 | [diff] [blame] | 796 | * <p>When a precapture metering sequence is finished, the camera device |
| 797 | * may lock the auto-exposure routine internally to be able to accurately expose the |
| 798 | * subsequent still capture image (<code>{@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} == STILL_CAPTURE</code>). |
| 799 | * For this case, the AE may not resume normal scan if no subsequent still capture is |
| 800 | * submitted. To ensure that the AE routine restarts normal scan, the application should |
| 801 | * submit a request with <code>{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} == true</code>, followed by a request |
| 802 | * 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] | 803 | * still capture request after the precapture sequence completes. Alternatively, for |
| 804 | * API level 23 or newer devices, the CANCEL can be used to unlock the camera device |
| 805 | * internally locked AE if the application doesn't submit a still capture request after |
| 806 | * the AE precapture trigger. Note that, the CANCEL was added in API level 23, and must not |
| 807 | * be used in devices that have earlier API levels.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 808 | * <p>The exact effect of auto-exposure (AE) precapture trigger |
| 809 | * depends on the current AE mode and state; see |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 810 | * {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE precapture state transition |
| 811 | * details.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 812 | * <p>On LEGACY-level devices, the precapture trigger is not supported; |
| 813 | * capturing a high-resolution JPEG image will automatically trigger a |
| 814 | * precapture sequence before the high-resolution capture, including |
| 815 | * potentially firing a pre-capture flash.</p> |
Eino-Ville Talvala | f8a2f57 | 2015-06-24 15:36:38 -0700 | [diff] [blame] | 816 | * <p>Using the precapture trigger and the auto-focus trigger {@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger} |
| 817 | * simultaneously is allowed. However, since these triggers often require cooperation between |
| 818 | * the auto-focus and auto-exposure routines (for example, the may need to be enabled for a |
| 819 | * focus sweep), the camera device may delay acting on a later trigger until the previous |
| 820 | * trigger has been fully handled. This may lead to longer intervals between the trigger and |
| 821 | * changes to {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} indicating the start of the precapture sequence, for |
| 822 | * example.</p> |
| 823 | * <p>If both the precapture and the auto-focus trigger are activated on the same request, then |
| 824 | * 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] | 825 | * <p><b>Possible values:</b> |
| 826 | * <ul> |
| 827 | * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE IDLE}</li> |
| 828 | * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_START START}</li> |
Zhijun He | fa95b04 | 2015-02-09 10:40:49 -0800 | [diff] [blame] | 829 | * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL CANCEL}</li> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 830 | * </ul></p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 831 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 832 | * <p><b>Limited capability</b> - |
| 833 | * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the |
| 834 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 835 | * |
Zhijun He | dd72be5 | 2015-02-06 13:49:51 -0800 | [diff] [blame] | 836 | * @see CaptureRequest#CONTROL_AE_LOCK |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 837 | * @see CaptureResult#CONTROL_AE_STATE |
Eino-Ville Talvala | f8a2f57 | 2015-06-24 15:36:38 -0700 | [diff] [blame] | 838 | * @see CaptureRequest#CONTROL_AF_TRIGGER |
Zhijun He | dd72be5 | 2015-02-06 13:49:51 -0800 | [diff] [blame] | 839 | * @see CaptureRequest#CONTROL_CAPTURE_INTENT |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 840 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 841 | * @see #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE |
| 842 | * @see #CONTROL_AE_PRECAPTURE_TRIGGER_START |
Zhijun He | fa95b04 | 2015-02-09 10:40:49 -0800 | [diff] [blame] | 843 | * @see #CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 844 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 845 | @PublicKey |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 846 | public static final Key<Integer> CONTROL_AE_PRECAPTURE_TRIGGER = |
| 847 | new Key<Integer>("android.control.aePrecaptureTrigger", int.class); |
| 848 | |
| 849 | /** |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 850 | * <p>Current state of the auto-exposure (AE) algorithm.</p> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 851 | * <p>Switching between or enabling AE modes ({@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}) always |
| 852 | * resets the AE state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode}, |
| 853 | * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all |
| 854 | * the algorithm states to INACTIVE.</p> |
| 855 | * <p>The camera device can do several state transitions between two results, if it is |
| 856 | * allowed by the state transition table. For example: INACTIVE may never actually be |
| 857 | * seen in a result.</p> |
| 858 | * <p>The state in the result is the state for this image (in sync with this image): if |
| 859 | * AE state becomes CONVERGED, then the image data associated with this result should |
| 860 | * be good to use.</p> |
| 861 | * <p>Below are state transition tables for different AE modes.</p> |
| 862 | * <table> |
| 863 | * <thead> |
| 864 | * <tr> |
| 865 | * <th align="center">State</th> |
| 866 | * <th align="center">Transition Cause</th> |
| 867 | * <th align="center">New State</th> |
| 868 | * <th align="center">Notes</th> |
| 869 | * </tr> |
| 870 | * </thead> |
| 871 | * <tbody> |
| 872 | * <tr> |
| 873 | * <td align="center">INACTIVE</td> |
| 874 | * <td align="center"></td> |
| 875 | * <td align="center">INACTIVE</td> |
| 876 | * <td align="center">Camera device auto exposure algorithm is disabled</td> |
| 877 | * </tr> |
| 878 | * </tbody> |
| 879 | * </table> |
| 880 | * <p>When {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is AE_MODE_ON_*:</p> |
| 881 | * <table> |
| 882 | * <thead> |
| 883 | * <tr> |
| 884 | * <th align="center">State</th> |
| 885 | * <th align="center">Transition Cause</th> |
| 886 | * <th align="center">New State</th> |
| 887 | * <th align="center">Notes</th> |
| 888 | * </tr> |
| 889 | * </thead> |
| 890 | * <tbody> |
| 891 | * <tr> |
| 892 | * <td align="center">INACTIVE</td> |
| 893 | * <td align="center">Camera device initiates AE scan</td> |
| 894 | * <td align="center">SEARCHING</td> |
| 895 | * <td align="center">Values changing</td> |
| 896 | * </tr> |
| 897 | * <tr> |
| 898 | * <td align="center">INACTIVE</td> |
| 899 | * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td> |
| 900 | * <td align="center">LOCKED</td> |
| 901 | * <td align="center">Values locked</td> |
| 902 | * </tr> |
| 903 | * <tr> |
| 904 | * <td align="center">SEARCHING</td> |
| 905 | * <td align="center">Camera device finishes AE scan</td> |
| 906 | * <td align="center">CONVERGED</td> |
| 907 | * <td align="center">Good values, not changing</td> |
| 908 | * </tr> |
| 909 | * <tr> |
| 910 | * <td align="center">SEARCHING</td> |
| 911 | * <td align="center">Camera device finishes AE scan</td> |
| 912 | * <td align="center">FLASH_REQUIRED</td> |
| 913 | * <td align="center">Converged but too dark w/o flash</td> |
| 914 | * </tr> |
| 915 | * <tr> |
| 916 | * <td align="center">SEARCHING</td> |
| 917 | * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td> |
| 918 | * <td align="center">LOCKED</td> |
| 919 | * <td align="center">Values locked</td> |
| 920 | * </tr> |
| 921 | * <tr> |
| 922 | * <td align="center">CONVERGED</td> |
| 923 | * <td align="center">Camera device initiates AE scan</td> |
| 924 | * <td align="center">SEARCHING</td> |
| 925 | * <td align="center">Values changing</td> |
| 926 | * </tr> |
| 927 | * <tr> |
| 928 | * <td align="center">CONVERGED</td> |
| 929 | * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td> |
| 930 | * <td align="center">LOCKED</td> |
| 931 | * <td align="center">Values locked</td> |
| 932 | * </tr> |
| 933 | * <tr> |
| 934 | * <td align="center">FLASH_REQUIRED</td> |
| 935 | * <td align="center">Camera device initiates AE scan</td> |
| 936 | * <td align="center">SEARCHING</td> |
| 937 | * <td align="center">Values changing</td> |
| 938 | * </tr> |
| 939 | * <tr> |
| 940 | * <td align="center">FLASH_REQUIRED</td> |
| 941 | * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td> |
| 942 | * <td align="center">LOCKED</td> |
| 943 | * <td align="center">Values locked</td> |
| 944 | * </tr> |
| 945 | * <tr> |
| 946 | * <td align="center">LOCKED</td> |
| 947 | * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td> |
| 948 | * <td align="center">SEARCHING</td> |
| 949 | * <td align="center">Values not good after unlock</td> |
| 950 | * </tr> |
| 951 | * <tr> |
| 952 | * <td align="center">LOCKED</td> |
| 953 | * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td> |
| 954 | * <td align="center">CONVERGED</td> |
| 955 | * <td align="center">Values good after unlock</td> |
| 956 | * </tr> |
| 957 | * <tr> |
| 958 | * <td align="center">LOCKED</td> |
| 959 | * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td> |
| 960 | * <td align="center">FLASH_REQUIRED</td> |
| 961 | * <td align="center">Exposure good, but too dark</td> |
| 962 | * </tr> |
| 963 | * <tr> |
| 964 | * <td align="center">PRECAPTURE</td> |
| 965 | * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td> |
| 966 | * <td align="center">CONVERGED</td> |
| 967 | * <td align="center">Ready for high-quality capture</td> |
| 968 | * </tr> |
| 969 | * <tr> |
| 970 | * <td align="center">PRECAPTURE</td> |
| 971 | * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td> |
| 972 | * <td align="center">LOCKED</td> |
| 973 | * <td align="center">Ready for high-quality capture</td> |
| 974 | * </tr> |
| 975 | * <tr> |
Zhijun He | fa95b04 | 2015-02-09 10:40:49 -0800 | [diff] [blame] | 976 | * <td align="center">LOCKED</td> |
| 977 | * <td align="center">aeLock is ON and aePrecaptureTrigger is START</td> |
| 978 | * <td align="center">LOCKED</td> |
| 979 | * <td align="center">Precapture trigger is ignored when AE is already locked</td> |
| 980 | * </tr> |
| 981 | * <tr> |
| 982 | * <td align="center">LOCKED</td> |
| 983 | * <td align="center">aeLock is ON and aePrecaptureTrigger is CANCEL</td> |
| 984 | * <td align="center">LOCKED</td> |
| 985 | * <td align="center">Precapture trigger is ignored when AE is already locked</td> |
| 986 | * </tr> |
| 987 | * <tr> |
| 988 | * <td align="center">Any state (excluding LOCKED)</td> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 989 | * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START</td> |
| 990 | * <td align="center">PRECAPTURE</td> |
| 991 | * <td align="center">Start AE precapture metering sequence</td> |
| 992 | * </tr> |
Zhijun He | fa95b04 | 2015-02-09 10:40:49 -0800 | [diff] [blame] | 993 | * <tr> |
| 994 | * <td align="center">Any state (excluding LOCKED)</td> |
| 995 | * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is CANCEL</td> |
| 996 | * <td align="center">INACTIVE</td> |
| 997 | * <td align="center">Currently active precapture metering sequence is canceled</td> |
| 998 | * </tr> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 999 | * </tbody> |
| 1000 | * </table> |
Zhijun He | 60b19dc | 2014-02-24 10:19:20 -0800 | [diff] [blame] | 1001 | * <p>For the above table, the camera device may skip reporting any state changes that happen |
| 1002 | * without application intervention (i.e. mode switch, trigger, locking). Any state that |
| 1003 | * can be skipped in that manner is called a transient state.</p> |
| 1004 | * <p>For example, for above AE modes (AE_MODE_ON_*), in addition to the state transitions |
| 1005 | * listed in above table, it is also legal for the camera device to skip one or more |
| 1006 | * transient states between two results. See below table for examples:</p> |
| 1007 | * <table> |
| 1008 | * <thead> |
| 1009 | * <tr> |
| 1010 | * <th align="center">State</th> |
| 1011 | * <th align="center">Transition Cause</th> |
| 1012 | * <th align="center">New State</th> |
| 1013 | * <th align="center">Notes</th> |
| 1014 | * </tr> |
| 1015 | * </thead> |
| 1016 | * <tbody> |
| 1017 | * <tr> |
| 1018 | * <td align="center">INACTIVE</td> |
| 1019 | * <td align="center">Camera device finished AE scan</td> |
| 1020 | * <td align="center">CONVERGED</td> |
| 1021 | * <td align="center">Values are already good, transient states are skipped by camera device.</td> |
| 1022 | * </tr> |
| 1023 | * <tr> |
Zhijun He | fa95b04 | 2015-02-09 10:40:49 -0800 | [diff] [blame] | 1024 | * <td align="center">Any state (excluding LOCKED)</td> |
Zhijun He | 60b19dc | 2014-02-24 10:19:20 -0800 | [diff] [blame] | 1025 | * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td> |
| 1026 | * <td align="center">FLASH_REQUIRED</td> |
| 1027 | * <td align="center">Converged but too dark w/o flash after a precapture sequence, transient states are skipped by camera device.</td> |
| 1028 | * </tr> |
| 1029 | * <tr> |
Zhijun He | fa95b04 | 2015-02-09 10:40:49 -0800 | [diff] [blame] | 1030 | * <td align="center">Any state (excluding LOCKED)</td> |
Zhijun He | 60b19dc | 2014-02-24 10:19:20 -0800 | [diff] [blame] | 1031 | * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td> |
| 1032 | * <td align="center">CONVERGED</td> |
| 1033 | * <td align="center">Converged after a precapture sequence, transient states are skipped by camera device.</td> |
| 1034 | * </tr> |
| 1035 | * <tr> |
Zhijun He | fa95b04 | 2015-02-09 10:40:49 -0800 | [diff] [blame] | 1036 | * <td align="center">Any state (excluding LOCKED)</td> |
| 1037 | * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is CANCEL, converged</td> |
| 1038 | * <td align="center">FLASH_REQUIRED</td> |
| 1039 | * <td align="center">Converged but too dark w/o flash after a precapture sequence is canceled, transient states are skipped by camera device.</td> |
| 1040 | * </tr> |
| 1041 | * <tr> |
| 1042 | * <td align="center">Any state (excluding LOCKED)</td> |
| 1043 | * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is CANCEL, converged</td> |
| 1044 | * <td align="center">CONVERGED</td> |
| 1045 | * <td align="center">Converged after a precapture sequenceis canceled, transient states are skipped by camera device.</td> |
| 1046 | * </tr> |
| 1047 | * <tr> |
Zhijun He | 60b19dc | 2014-02-24 10:19:20 -0800 | [diff] [blame] | 1048 | * <td align="center">CONVERGED</td> |
| 1049 | * <td align="center">Camera device finished AE scan</td> |
| 1050 | * <td align="center">FLASH_REQUIRED</td> |
| 1051 | * <td align="center">Converged but too dark w/o flash after a new scan, transient states are skipped by camera device.</td> |
| 1052 | * </tr> |
| 1053 | * <tr> |
| 1054 | * <td align="center">FLASH_REQUIRED</td> |
| 1055 | * <td align="center">Camera device finished AE scan</td> |
| 1056 | * <td align="center">CONVERGED</td> |
| 1057 | * <td align="center">Converged after a new scan, transient states are skipped by camera device.</td> |
| 1058 | * </tr> |
| 1059 | * </tbody> |
| 1060 | * </table> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1061 | * <p><b>Possible values:</b> |
| 1062 | * <ul> |
| 1063 | * <li>{@link #CONTROL_AE_STATE_INACTIVE INACTIVE}</li> |
| 1064 | * <li>{@link #CONTROL_AE_STATE_SEARCHING SEARCHING}</li> |
| 1065 | * <li>{@link #CONTROL_AE_STATE_CONVERGED CONVERGED}</li> |
| 1066 | * <li>{@link #CONTROL_AE_STATE_LOCKED LOCKED}</li> |
| 1067 | * <li>{@link #CONTROL_AE_STATE_FLASH_REQUIRED FLASH_REQUIRED}</li> |
| 1068 | * <li>{@link #CONTROL_AE_STATE_PRECAPTURE PRECAPTURE}</li> |
| 1069 | * </ul></p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1070 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 1071 | * <p><b>Limited capability</b> - |
| 1072 | * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the |
| 1073 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 1074 | * |
| 1075 | * @see CaptureRequest#CONTROL_AE_LOCK |
| 1076 | * @see CaptureRequest#CONTROL_AE_MODE |
| 1077 | * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER |
| 1078 | * @see CaptureRequest#CONTROL_MODE |
| 1079 | * @see CaptureRequest#CONTROL_SCENE_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1080 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1081 | * @see #CONTROL_AE_STATE_INACTIVE |
| 1082 | * @see #CONTROL_AE_STATE_SEARCHING |
| 1083 | * @see #CONTROL_AE_STATE_CONVERGED |
| 1084 | * @see #CONTROL_AE_STATE_LOCKED |
| 1085 | * @see #CONTROL_AE_STATE_FLASH_REQUIRED |
| 1086 | * @see #CONTROL_AE_STATE_PRECAPTURE |
| 1087 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1088 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1089 | public static final Key<Integer> CONTROL_AE_STATE = |
| 1090 | new Key<Integer>("android.control.aeState", int.class); |
| 1091 | |
| 1092 | /** |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 1093 | * <p>Whether auto-focus (AF) is currently enabled, and what |
| 1094 | * mode it is set to.</p> |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 1095 | * <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] | 1096 | * (i.e. <code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} > 0</code>). Also note that |
| 1097 | * when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF, the behavior of AF is device |
| 1098 | * dependent. It is recommended to lock AF by using {@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger} before |
| 1099 | * 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] | 1100 | * <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] | 1101 | * 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] | 1102 | * in result metadata.</p> |
| 1103 | * <p><b>Possible values:</b> |
| 1104 | * <ul> |
| 1105 | * <li>{@link #CONTROL_AF_MODE_OFF OFF}</li> |
| 1106 | * <li>{@link #CONTROL_AF_MODE_AUTO AUTO}</li> |
| 1107 | * <li>{@link #CONTROL_AF_MODE_MACRO MACRO}</li> |
| 1108 | * <li>{@link #CONTROL_AF_MODE_CONTINUOUS_VIDEO CONTINUOUS_VIDEO}</li> |
| 1109 | * <li>{@link #CONTROL_AF_MODE_CONTINUOUS_PICTURE CONTINUOUS_PICTURE}</li> |
| 1110 | * <li>{@link #CONTROL_AF_MODE_EDOF EDOF}</li> |
| 1111 | * </ul></p> |
| 1112 | * <p><b>Available values for this device:</b><br> |
| 1113 | * {@link CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES android.control.afAvailableModes}</p> |
| 1114 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1115 | * |
Yin-Chia Yeh | 7144b5d | 2014-11-12 11:42:49 -0800 | [diff] [blame] | 1116 | * @see CaptureRequest#CONTROL_AE_MODE |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1117 | * @see CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES |
Eino-Ville Talvala | d8fd679 | 2014-02-10 12:41:04 -0800 | [diff] [blame] | 1118 | * @see CaptureResult#CONTROL_AF_STATE |
Yin-Chia Yeh | 7144b5d | 2014-11-12 11:42:49 -0800 | [diff] [blame] | 1119 | * @see CaptureRequest#CONTROL_AF_TRIGGER |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1120 | * @see CaptureRequest#CONTROL_MODE |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 1121 | * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1122 | * @see #CONTROL_AF_MODE_OFF |
| 1123 | * @see #CONTROL_AF_MODE_AUTO |
| 1124 | * @see #CONTROL_AF_MODE_MACRO |
| 1125 | * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO |
| 1126 | * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE |
| 1127 | * @see #CONTROL_AF_MODE_EDOF |
| 1128 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1129 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1130 | public static final Key<Integer> CONTROL_AF_MODE = |
| 1131 | new Key<Integer>("android.control.afMode", int.class); |
| 1132 | |
| 1133 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1134 | * <p>List of metering areas to use for auto-focus.</p> |
| 1135 | * <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] | 1136 | * Otherwise will always be present.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1137 | * <p>The maximum number of focus areas supported by the device is determined by the value |
| 1138 | * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf}.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1139 | * <p>The coordinate system is based on the active pixel array, |
Timothy Knight | 2629f27 | 2013-09-03 17:23:23 -0700 | [diff] [blame] | 1140 | * with (0,0) being the top-left pixel in the active pixel array, and |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1141 | * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1, |
| 1142 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the |
Yin-Chia Yeh | 97f1c85 | 2014-05-28 16:36:05 -0700 | [diff] [blame] | 1143 | * bottom-right pixel in the active pixel array.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1144 | * <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] | 1145 | * for every pixel in the area. This means that a large metering area |
| 1146 | * with the same weight as a smaller area will have more effect in |
| 1147 | * the metering result. Metering areas can partially overlap and the |
| 1148 | * camera device will add the weights in the overlap region.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1149 | * <p>The weights are relative to weights of other metering regions, so if only one region |
| 1150 | * is used, all non-zero weights will have the same effect. A region with 0 weight is |
| 1151 | * ignored.</p> |
| 1152 | * <p>If all regions have 0 weight, then no specific metering area needs to be used by the |
| 1153 | * camera device.</p> |
| 1154 | * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in |
| 1155 | * capture result metadata, the camera device will ignore the sections outside the crop |
| 1156 | * region and output only the intersection rectangle as the metering region in the result |
| 1157 | * metadata. If the region is entirely outside the crop region, it will be ignored and |
| 1158 | * not reported in the result metadata.</p> |
| 1159 | * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p> |
| 1160 | * <p><b>Range of valid values:</b><br> |
| 1161 | * Coordinates must be between <code>[(0,0), (width, height))</code> of |
| 1162 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p> |
Yin-Chia Yeh | 808150f | 2014-09-08 15:48:47 -0700 | [diff] [blame] | 1163 | * <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] | 1164 | * |
Yin-Chia Yeh | 808150f | 2014-09-08 15:48:47 -0700 | [diff] [blame] | 1165 | * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AF |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1166 | * @see CaptureRequest#SCALER_CROP_REGION |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 1167 | * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1168 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1169 | @PublicKey |
Yin-Chia Yeh | 817f893 | 2014-05-19 10:23:27 -0700 | [diff] [blame] | 1170 | public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AF_REGIONS = |
| 1171 | 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] | 1172 | |
| 1173 | /** |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 1174 | * <p>Whether the camera device will trigger autofocus for this request.</p> |
| 1175 | * <p>This entry is normally set to IDLE, or is not |
| 1176 | * included at all in the request settings.</p> |
| 1177 | * <p>When included and set to START, the camera device will trigger the |
| 1178 | * autofocus algorithm. If autofocus is disabled, this trigger has no effect.</p> |
| 1179 | * <p>When set to CANCEL, the camera device will cancel any active trigger, |
| 1180 | * and return to its initial AF state.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1181 | * <p>Generally, applications should set this entry to START or CANCEL for only a |
| 1182 | * single capture, and then return it to IDLE (or not set at all). Specifying |
| 1183 | * START for multiple captures in a row means restarting the AF operation over |
| 1184 | * and over again.</p> |
| 1185 | * <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] | 1186 | * <p>Using the autofocus trigger and the precapture trigger {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} |
| 1187 | * simultaneously is allowed. However, since these triggers often require cooperation between |
| 1188 | * the auto-focus and auto-exposure routines (for example, the may need to be enabled for a |
| 1189 | * focus sweep), the camera device may delay acting on a later trigger until the previous |
| 1190 | * trigger has been fully handled. This may lead to longer intervals between the trigger and |
| 1191 | * 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] | 1192 | * <p><b>Possible values:</b> |
| 1193 | * <ul> |
| 1194 | * <li>{@link #CONTROL_AF_TRIGGER_IDLE IDLE}</li> |
| 1195 | * <li>{@link #CONTROL_AF_TRIGGER_START START}</li> |
| 1196 | * <li>{@link #CONTROL_AF_TRIGGER_CANCEL CANCEL}</li> |
| 1197 | * </ul></p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1198 | * <p>This key is available on all devices.</p> |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 1199 | * |
Eino-Ville Talvala | f8a2f57 | 2015-06-24 15:36:38 -0700 | [diff] [blame] | 1200 | * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 1201 | * @see CaptureResult#CONTROL_AF_STATE |
| 1202 | * @see #CONTROL_AF_TRIGGER_IDLE |
| 1203 | * @see #CONTROL_AF_TRIGGER_START |
| 1204 | * @see #CONTROL_AF_TRIGGER_CANCEL |
| 1205 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1206 | @PublicKey |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 1207 | public static final Key<Integer> CONTROL_AF_TRIGGER = |
| 1208 | new Key<Integer>("android.control.afTrigger", int.class); |
| 1209 | |
| 1210 | /** |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 1211 | * <p>Current state of auto-focus (AF) algorithm.</p> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 1212 | * <p>Switching between or enabling AF modes ({@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}) always |
| 1213 | * resets the AF state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode}, |
| 1214 | * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all |
| 1215 | * the algorithm states to INACTIVE.</p> |
| 1216 | * <p>The camera device can do several state transitions between two results, if it is |
| 1217 | * allowed by the state transition table. For example: INACTIVE may never actually be |
| 1218 | * seen in a result.</p> |
| 1219 | * <p>The state in the result is the state for this image (in sync with this image): if |
| 1220 | * AF state becomes FOCUSED, then the image data associated with this result should |
| 1221 | * be sharp.</p> |
| 1222 | * <p>Below are state transition tables for different AF modes.</p> |
| 1223 | * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_OFF or AF_MODE_EDOF:</p> |
| 1224 | * <table> |
| 1225 | * <thead> |
| 1226 | * <tr> |
| 1227 | * <th align="center">State</th> |
| 1228 | * <th align="center">Transition Cause</th> |
| 1229 | * <th align="center">New State</th> |
| 1230 | * <th align="center">Notes</th> |
| 1231 | * </tr> |
| 1232 | * </thead> |
| 1233 | * <tbody> |
| 1234 | * <tr> |
| 1235 | * <td align="center">INACTIVE</td> |
| 1236 | * <td align="center"></td> |
| 1237 | * <td align="center">INACTIVE</td> |
| 1238 | * <td align="center">Never changes</td> |
| 1239 | * </tr> |
| 1240 | * </tbody> |
| 1241 | * </table> |
| 1242 | * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_AUTO or AF_MODE_MACRO:</p> |
| 1243 | * <table> |
| 1244 | * <thead> |
| 1245 | * <tr> |
| 1246 | * <th align="center">State</th> |
| 1247 | * <th align="center">Transition Cause</th> |
| 1248 | * <th align="center">New State</th> |
| 1249 | * <th align="center">Notes</th> |
| 1250 | * </tr> |
| 1251 | * </thead> |
| 1252 | * <tbody> |
| 1253 | * <tr> |
| 1254 | * <td align="center">INACTIVE</td> |
| 1255 | * <td align="center">AF_TRIGGER</td> |
| 1256 | * <td align="center">ACTIVE_SCAN</td> |
| 1257 | * <td align="center">Start AF sweep, Lens now moving</td> |
| 1258 | * </tr> |
| 1259 | * <tr> |
| 1260 | * <td align="center">ACTIVE_SCAN</td> |
| 1261 | * <td align="center">AF sweep done</td> |
| 1262 | * <td align="center">FOCUSED_LOCKED</td> |
| 1263 | * <td align="center">Focused, Lens now locked</td> |
| 1264 | * </tr> |
| 1265 | * <tr> |
| 1266 | * <td align="center">ACTIVE_SCAN</td> |
| 1267 | * <td align="center">AF sweep done</td> |
| 1268 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 1269 | * <td align="center">Not focused, Lens now locked</td> |
| 1270 | * </tr> |
| 1271 | * <tr> |
| 1272 | * <td align="center">ACTIVE_SCAN</td> |
| 1273 | * <td align="center">AF_CANCEL</td> |
| 1274 | * <td align="center">INACTIVE</td> |
| 1275 | * <td align="center">Cancel/reset AF, Lens now locked</td> |
| 1276 | * </tr> |
| 1277 | * <tr> |
| 1278 | * <td align="center">FOCUSED_LOCKED</td> |
| 1279 | * <td align="center">AF_CANCEL</td> |
| 1280 | * <td align="center">INACTIVE</td> |
| 1281 | * <td align="center">Cancel/reset AF</td> |
| 1282 | * </tr> |
| 1283 | * <tr> |
| 1284 | * <td align="center">FOCUSED_LOCKED</td> |
| 1285 | * <td align="center">AF_TRIGGER</td> |
| 1286 | * <td align="center">ACTIVE_SCAN</td> |
| 1287 | * <td align="center">Start new sweep, Lens now moving</td> |
| 1288 | * </tr> |
| 1289 | * <tr> |
| 1290 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 1291 | * <td align="center">AF_CANCEL</td> |
| 1292 | * <td align="center">INACTIVE</td> |
| 1293 | * <td align="center">Cancel/reset AF</td> |
| 1294 | * </tr> |
| 1295 | * <tr> |
| 1296 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 1297 | * <td align="center">AF_TRIGGER</td> |
| 1298 | * <td align="center">ACTIVE_SCAN</td> |
| 1299 | * <td align="center">Start new sweep, Lens now moving</td> |
| 1300 | * </tr> |
| 1301 | * <tr> |
| 1302 | * <td align="center">Any state</td> |
| 1303 | * <td align="center">Mode change</td> |
| 1304 | * <td align="center">INACTIVE</td> |
| 1305 | * <td align="center"></td> |
| 1306 | * </tr> |
| 1307 | * </tbody> |
| 1308 | * </table> |
Zhijun He | 60b19dc | 2014-02-24 10:19:20 -0800 | [diff] [blame] | 1309 | * <p>For the above table, the camera device may skip reporting any state changes that happen |
| 1310 | * without application intervention (i.e. mode switch, trigger, locking). Any state that |
| 1311 | * can be skipped in that manner is called a transient state.</p> |
| 1312 | * <p>For example, for these AF modes (AF_MODE_AUTO and AF_MODE_MACRO), in addition to the |
| 1313 | * state transitions listed in above table, it is also legal for the camera device to skip |
| 1314 | * one or more transient states between two results. See below table for examples:</p> |
| 1315 | * <table> |
| 1316 | * <thead> |
| 1317 | * <tr> |
| 1318 | * <th align="center">State</th> |
| 1319 | * <th align="center">Transition Cause</th> |
| 1320 | * <th align="center">New State</th> |
| 1321 | * <th align="center">Notes</th> |
| 1322 | * </tr> |
| 1323 | * </thead> |
| 1324 | * <tbody> |
| 1325 | * <tr> |
| 1326 | * <td align="center">INACTIVE</td> |
| 1327 | * <td align="center">AF_TRIGGER</td> |
| 1328 | * <td align="center">FOCUSED_LOCKED</td> |
| 1329 | * <td align="center">Focus is already good or good after a scan, lens is now locked.</td> |
| 1330 | * </tr> |
| 1331 | * <tr> |
| 1332 | * <td align="center">INACTIVE</td> |
| 1333 | * <td align="center">AF_TRIGGER</td> |
| 1334 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 1335 | * <td align="center">Focus failed after a scan, lens is now locked.</td> |
| 1336 | * </tr> |
| 1337 | * <tr> |
| 1338 | * <td align="center">FOCUSED_LOCKED</td> |
| 1339 | * <td align="center">AF_TRIGGER</td> |
| 1340 | * <td align="center">FOCUSED_LOCKED</td> |
| 1341 | * <td align="center">Focus is already good or good after a scan, lens is now locked.</td> |
| 1342 | * </tr> |
| 1343 | * <tr> |
| 1344 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 1345 | * <td align="center">AF_TRIGGER</td> |
| 1346 | * <td align="center">FOCUSED_LOCKED</td> |
| 1347 | * <td align="center">Focus is good after a scan, lens is not locked.</td> |
| 1348 | * </tr> |
| 1349 | * </tbody> |
| 1350 | * </table> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 1351 | * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_VIDEO:</p> |
| 1352 | * <table> |
| 1353 | * <thead> |
| 1354 | * <tr> |
| 1355 | * <th align="center">State</th> |
| 1356 | * <th align="center">Transition Cause</th> |
| 1357 | * <th align="center">New State</th> |
| 1358 | * <th align="center">Notes</th> |
| 1359 | * </tr> |
| 1360 | * </thead> |
| 1361 | * <tbody> |
| 1362 | * <tr> |
| 1363 | * <td align="center">INACTIVE</td> |
| 1364 | * <td align="center">Camera device initiates new scan</td> |
| 1365 | * <td align="center">PASSIVE_SCAN</td> |
| 1366 | * <td align="center">Start AF scan, Lens now moving</td> |
| 1367 | * </tr> |
| 1368 | * <tr> |
| 1369 | * <td align="center">INACTIVE</td> |
| 1370 | * <td align="center">AF_TRIGGER</td> |
| 1371 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 1372 | * <td align="center">AF state query, Lens now locked</td> |
| 1373 | * </tr> |
| 1374 | * <tr> |
| 1375 | * <td align="center">PASSIVE_SCAN</td> |
| 1376 | * <td align="center">Camera device completes current scan</td> |
| 1377 | * <td align="center">PASSIVE_FOCUSED</td> |
| 1378 | * <td align="center">End AF scan, Lens now locked</td> |
| 1379 | * </tr> |
| 1380 | * <tr> |
| 1381 | * <td align="center">PASSIVE_SCAN</td> |
| 1382 | * <td align="center">Camera device fails current scan</td> |
| 1383 | * <td align="center">PASSIVE_UNFOCUSED</td> |
| 1384 | * <td align="center">End AF scan, Lens now locked</td> |
| 1385 | * </tr> |
| 1386 | * <tr> |
| 1387 | * <td align="center">PASSIVE_SCAN</td> |
| 1388 | * <td align="center">AF_TRIGGER</td> |
| 1389 | * <td align="center">FOCUSED_LOCKED</td> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1390 | * <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] | 1391 | * </tr> |
| 1392 | * <tr> |
| 1393 | * <td align="center">PASSIVE_SCAN</td> |
| 1394 | * <td align="center">AF_TRIGGER</td> |
| 1395 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1396 | * <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] | 1397 | * </tr> |
| 1398 | * <tr> |
| 1399 | * <td align="center">PASSIVE_SCAN</td> |
| 1400 | * <td align="center">AF_CANCEL</td> |
| 1401 | * <td align="center">INACTIVE</td> |
| 1402 | * <td align="center">Reset lens position, Lens now locked</td> |
| 1403 | * </tr> |
| 1404 | * <tr> |
| 1405 | * <td align="center">PASSIVE_FOCUSED</td> |
| 1406 | * <td align="center">Camera device initiates new scan</td> |
| 1407 | * <td align="center">PASSIVE_SCAN</td> |
| 1408 | * <td align="center">Start AF scan, Lens now moving</td> |
| 1409 | * </tr> |
| 1410 | * <tr> |
| 1411 | * <td align="center">PASSIVE_UNFOCUSED</td> |
| 1412 | * <td align="center">Camera device initiates new scan</td> |
| 1413 | * <td align="center">PASSIVE_SCAN</td> |
| 1414 | * <td align="center">Start AF scan, Lens now moving</td> |
| 1415 | * </tr> |
| 1416 | * <tr> |
| 1417 | * <td align="center">PASSIVE_FOCUSED</td> |
| 1418 | * <td align="center">AF_TRIGGER</td> |
| 1419 | * <td align="center">FOCUSED_LOCKED</td> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1420 | * <td align="center">Immediate transition, lens now locked</td> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 1421 | * </tr> |
| 1422 | * <tr> |
| 1423 | * <td align="center">PASSIVE_UNFOCUSED</td> |
| 1424 | * <td align="center">AF_TRIGGER</td> |
| 1425 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1426 | * <td align="center">Immediate transition, lens now locked</td> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 1427 | * </tr> |
| 1428 | * <tr> |
| 1429 | * <td align="center">FOCUSED_LOCKED</td> |
| 1430 | * <td align="center">AF_TRIGGER</td> |
| 1431 | * <td align="center">FOCUSED_LOCKED</td> |
| 1432 | * <td align="center">No effect</td> |
| 1433 | * </tr> |
| 1434 | * <tr> |
| 1435 | * <td align="center">FOCUSED_LOCKED</td> |
| 1436 | * <td align="center">AF_CANCEL</td> |
| 1437 | * <td align="center">INACTIVE</td> |
| 1438 | * <td align="center">Restart AF scan</td> |
| 1439 | * </tr> |
| 1440 | * <tr> |
| 1441 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 1442 | * <td align="center">AF_TRIGGER</td> |
| 1443 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 1444 | * <td align="center">No effect</td> |
| 1445 | * </tr> |
| 1446 | * <tr> |
| 1447 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 1448 | * <td align="center">AF_CANCEL</td> |
| 1449 | * <td align="center">INACTIVE</td> |
| 1450 | * <td align="center">Restart AF scan</td> |
| 1451 | * </tr> |
| 1452 | * </tbody> |
| 1453 | * </table> |
| 1454 | * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_PICTURE:</p> |
| 1455 | * <table> |
| 1456 | * <thead> |
| 1457 | * <tr> |
| 1458 | * <th align="center">State</th> |
| 1459 | * <th align="center">Transition Cause</th> |
| 1460 | * <th align="center">New State</th> |
| 1461 | * <th align="center">Notes</th> |
| 1462 | * </tr> |
| 1463 | * </thead> |
| 1464 | * <tbody> |
| 1465 | * <tr> |
| 1466 | * <td align="center">INACTIVE</td> |
| 1467 | * <td align="center">Camera device initiates new scan</td> |
| 1468 | * <td align="center">PASSIVE_SCAN</td> |
| 1469 | * <td align="center">Start AF scan, Lens now moving</td> |
| 1470 | * </tr> |
| 1471 | * <tr> |
| 1472 | * <td align="center">INACTIVE</td> |
| 1473 | * <td align="center">AF_TRIGGER</td> |
| 1474 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 1475 | * <td align="center">AF state query, Lens now locked</td> |
| 1476 | * </tr> |
| 1477 | * <tr> |
| 1478 | * <td align="center">PASSIVE_SCAN</td> |
| 1479 | * <td align="center">Camera device completes current scan</td> |
| 1480 | * <td align="center">PASSIVE_FOCUSED</td> |
| 1481 | * <td align="center">End AF scan, Lens now locked</td> |
| 1482 | * </tr> |
| 1483 | * <tr> |
| 1484 | * <td align="center">PASSIVE_SCAN</td> |
| 1485 | * <td align="center">Camera device fails current scan</td> |
| 1486 | * <td align="center">PASSIVE_UNFOCUSED</td> |
| 1487 | * <td align="center">End AF scan, Lens now locked</td> |
| 1488 | * </tr> |
| 1489 | * <tr> |
| 1490 | * <td align="center">PASSIVE_SCAN</td> |
| 1491 | * <td align="center">AF_TRIGGER</td> |
| 1492 | * <td align="center">FOCUSED_LOCKED</td> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1493 | * <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] | 1494 | * </tr> |
| 1495 | * <tr> |
| 1496 | * <td align="center">PASSIVE_SCAN</td> |
| 1497 | * <td align="center">AF_TRIGGER</td> |
| 1498 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1499 | * <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] | 1500 | * </tr> |
| 1501 | * <tr> |
| 1502 | * <td align="center">PASSIVE_SCAN</td> |
| 1503 | * <td align="center">AF_CANCEL</td> |
| 1504 | * <td align="center">INACTIVE</td> |
| 1505 | * <td align="center">Reset lens position, Lens now locked</td> |
| 1506 | * </tr> |
| 1507 | * <tr> |
| 1508 | * <td align="center">PASSIVE_FOCUSED</td> |
| 1509 | * <td align="center">Camera device initiates new scan</td> |
| 1510 | * <td align="center">PASSIVE_SCAN</td> |
| 1511 | * <td align="center">Start AF scan, Lens now moving</td> |
| 1512 | * </tr> |
| 1513 | * <tr> |
| 1514 | * <td align="center">PASSIVE_UNFOCUSED</td> |
| 1515 | * <td align="center">Camera device initiates new scan</td> |
| 1516 | * <td align="center">PASSIVE_SCAN</td> |
| 1517 | * <td align="center">Start AF scan, Lens now moving</td> |
| 1518 | * </tr> |
| 1519 | * <tr> |
| 1520 | * <td align="center">PASSIVE_FOCUSED</td> |
| 1521 | * <td align="center">AF_TRIGGER</td> |
| 1522 | * <td align="center">FOCUSED_LOCKED</td> |
| 1523 | * <td align="center">Immediate trans. Lens now locked</td> |
| 1524 | * </tr> |
| 1525 | * <tr> |
| 1526 | * <td align="center">PASSIVE_UNFOCUSED</td> |
| 1527 | * <td align="center">AF_TRIGGER</td> |
| 1528 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 1529 | * <td align="center">Immediate trans. Lens now locked</td> |
| 1530 | * </tr> |
| 1531 | * <tr> |
| 1532 | * <td align="center">FOCUSED_LOCKED</td> |
| 1533 | * <td align="center">AF_TRIGGER</td> |
| 1534 | * <td align="center">FOCUSED_LOCKED</td> |
| 1535 | * <td align="center">No effect</td> |
| 1536 | * </tr> |
| 1537 | * <tr> |
| 1538 | * <td align="center">FOCUSED_LOCKED</td> |
| 1539 | * <td align="center">AF_CANCEL</td> |
| 1540 | * <td align="center">INACTIVE</td> |
| 1541 | * <td align="center">Restart AF scan</td> |
| 1542 | * </tr> |
| 1543 | * <tr> |
| 1544 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 1545 | * <td align="center">AF_TRIGGER</td> |
| 1546 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 1547 | * <td align="center">No effect</td> |
| 1548 | * </tr> |
| 1549 | * <tr> |
| 1550 | * <td align="center">NOT_FOCUSED_LOCKED</td> |
| 1551 | * <td align="center">AF_CANCEL</td> |
| 1552 | * <td align="center">INACTIVE</td> |
| 1553 | * <td align="center">Restart AF scan</td> |
| 1554 | * </tr> |
| 1555 | * </tbody> |
| 1556 | * </table> |
Zhijun He | 60b19dc | 2014-02-24 10:19:20 -0800 | [diff] [blame] | 1557 | * <p>When switch between AF_MODE_CONTINUOUS_* (CAF modes) and AF_MODE_AUTO/AF_MODE_MACRO |
| 1558 | * (AUTO modes), the initial INACTIVE or PASSIVE_SCAN states may be skipped by the |
| 1559 | * camera device. When a trigger is included in a mode switch request, the trigger |
| 1560 | * will be evaluated in the context of the new mode in the request. |
| 1561 | * See below table for examples:</p> |
| 1562 | * <table> |
| 1563 | * <thead> |
| 1564 | * <tr> |
| 1565 | * <th align="center">State</th> |
| 1566 | * <th align="center">Transition Cause</th> |
| 1567 | * <th align="center">New State</th> |
| 1568 | * <th align="center">Notes</th> |
| 1569 | * </tr> |
| 1570 | * </thead> |
| 1571 | * <tbody> |
| 1572 | * <tr> |
| 1573 | * <td align="center">any state</td> |
| 1574 | * <td align="center">CAF-->AUTO mode switch</td> |
| 1575 | * <td align="center">INACTIVE</td> |
| 1576 | * <td align="center">Mode switch without trigger, initial state must be INACTIVE</td> |
| 1577 | * </tr> |
| 1578 | * <tr> |
| 1579 | * <td align="center">any state</td> |
| 1580 | * <td align="center">CAF-->AUTO mode switch with AF_TRIGGER</td> |
| 1581 | * <td align="center">trigger-reachable states from INACTIVE</td> |
| 1582 | * <td align="center">Mode switch with trigger, INACTIVE is skipped</td> |
| 1583 | * </tr> |
| 1584 | * <tr> |
| 1585 | * <td align="center">any state</td> |
| 1586 | * <td align="center">AUTO-->CAF mode switch</td> |
| 1587 | * <td align="center">passively reachable states from INACTIVE</td> |
| 1588 | * <td align="center">Mode switch without trigger, passive transient state is skipped</td> |
| 1589 | * </tr> |
| 1590 | * </tbody> |
| 1591 | * </table> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1592 | * <p><b>Possible values:</b> |
| 1593 | * <ul> |
| 1594 | * <li>{@link #CONTROL_AF_STATE_INACTIVE INACTIVE}</li> |
| 1595 | * <li>{@link #CONTROL_AF_STATE_PASSIVE_SCAN PASSIVE_SCAN}</li> |
| 1596 | * <li>{@link #CONTROL_AF_STATE_PASSIVE_FOCUSED PASSIVE_FOCUSED}</li> |
| 1597 | * <li>{@link #CONTROL_AF_STATE_ACTIVE_SCAN ACTIVE_SCAN}</li> |
| 1598 | * <li>{@link #CONTROL_AF_STATE_FOCUSED_LOCKED FOCUSED_LOCKED}</li> |
| 1599 | * <li>{@link #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED NOT_FOCUSED_LOCKED}</li> |
| 1600 | * <li>{@link #CONTROL_AF_STATE_PASSIVE_UNFOCUSED PASSIVE_UNFOCUSED}</li> |
| 1601 | * </ul></p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1602 | * <p>This key is available on all devices.</p> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 1603 | * |
| 1604 | * @see CaptureRequest#CONTROL_AF_MODE |
| 1605 | * @see CaptureRequest#CONTROL_MODE |
| 1606 | * @see CaptureRequest#CONTROL_SCENE_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1607 | * @see #CONTROL_AF_STATE_INACTIVE |
| 1608 | * @see #CONTROL_AF_STATE_PASSIVE_SCAN |
| 1609 | * @see #CONTROL_AF_STATE_PASSIVE_FOCUSED |
| 1610 | * @see #CONTROL_AF_STATE_ACTIVE_SCAN |
| 1611 | * @see #CONTROL_AF_STATE_FOCUSED_LOCKED |
| 1612 | * @see #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED |
Eino-Ville Talvala | 9f880f7 | 2013-09-20 17:50:41 -0700 | [diff] [blame] | 1613 | * @see #CONTROL_AF_STATE_PASSIVE_UNFOCUSED |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1614 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1615 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1616 | public static final Key<Integer> CONTROL_AF_STATE = |
| 1617 | new Key<Integer>("android.control.afState", int.class); |
| 1618 | |
| 1619 | /** |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 1620 | * <p>Whether auto-white balance (AWB) is currently locked to its |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 1621 | * latest calculated values.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1622 | * <p>When set to <code>true</code> (ON), the AWB algorithm is locked to its latest parameters, |
| 1623 | * and will not change color balance settings until the lock is set to <code>false</code> (OFF).</p> |
| 1624 | * <p>Since the camera device has a pipeline of in-flight requests, the settings that |
| 1625 | * get locked do not necessarily correspond to the settings that were present in the |
| 1626 | * latest capture result received from the camera device, since additional captures |
| 1627 | * and AWB updates may have occurred even before the result was sent out. If an |
| 1628 | * application is switching between automatic and manual control and wishes to eliminate |
| 1629 | * any flicker during the switch, the following procedure is recommended:</p> |
| 1630 | * <ol> |
| 1631 | * <li>Starting in auto-AWB mode:</li> |
| 1632 | * <li>Lock AWB</li> |
| 1633 | * <li>Wait for the first result to be output that has the AWB locked</li> |
| 1634 | * <li>Copy AWB settings from that result into a request, set the request to manual AWB</li> |
| 1635 | * <li>Submit the capture request, proceed to run manual AWB as desired.</li> |
| 1636 | * </ol> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1637 | * <p>Note that AWB lock is only meaningful when |
| 1638 | * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is in the AUTO mode; in other modes, |
| 1639 | * AWB is already fixed to a specific setting.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1640 | * <p>Some LEGACY devices may not support ON; the value is then overridden to OFF.</p> |
| 1641 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1642 | * |
| 1643 | * @see CaptureRequest#CONTROL_AWB_MODE |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 1644 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1645 | @PublicKey |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 1646 | public static final Key<Boolean> CONTROL_AWB_LOCK = |
| 1647 | new Key<Boolean>("android.control.awbLock", boolean.class); |
| 1648 | |
| 1649 | /** |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 1650 | * <p>Whether auto-white balance (AWB) is currently setting the color |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1651 | * transform fields, and what its illumination target |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 1652 | * is.</p> |
Zhijun He | 399f05d | 2014-01-15 11:31:30 -0800 | [diff] [blame] | 1653 | * <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] | 1654 | * <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] | 1655 | * routine is enabled, overriding the application's selected |
| 1656 | * {@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] | 1657 | * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}. Note that when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} |
| 1658 | * is OFF, the behavior of AWB is device dependent. It is recommened to |
| 1659 | * also set AWB mode to OFF or lock AWB by using {@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} before |
| 1660 | * setting AE mode to OFF.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1661 | * <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] | 1662 | * routine is disabled. The application manually controls the white |
Eino-Ville Talvala | d8fd679 | 2014-02-10 12:41:04 -0800 | [diff] [blame] | 1663 | * 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] | 1664 | * and {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1665 | * <p>When set to any other modes, the camera device's auto-white |
| 1666 | * balance routine is disabled. The camera device uses each |
| 1667 | * particular illumination target for white balance |
| 1668 | * adjustment. The application's values for |
| 1669 | * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, |
| 1670 | * {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and |
| 1671 | * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} are ignored.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1672 | * <p><b>Possible values:</b> |
| 1673 | * <ul> |
| 1674 | * <li>{@link #CONTROL_AWB_MODE_OFF OFF}</li> |
| 1675 | * <li>{@link #CONTROL_AWB_MODE_AUTO AUTO}</li> |
| 1676 | * <li>{@link #CONTROL_AWB_MODE_INCANDESCENT INCANDESCENT}</li> |
| 1677 | * <li>{@link #CONTROL_AWB_MODE_FLUORESCENT FLUORESCENT}</li> |
| 1678 | * <li>{@link #CONTROL_AWB_MODE_WARM_FLUORESCENT WARM_FLUORESCENT}</li> |
| 1679 | * <li>{@link #CONTROL_AWB_MODE_DAYLIGHT DAYLIGHT}</li> |
| 1680 | * <li>{@link #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT CLOUDY_DAYLIGHT}</li> |
| 1681 | * <li>{@link #CONTROL_AWB_MODE_TWILIGHT TWILIGHT}</li> |
| 1682 | * <li>{@link #CONTROL_AWB_MODE_SHADE SHADE}</li> |
| 1683 | * </ul></p> |
| 1684 | * <p><b>Available values for this device:</b><br> |
| 1685 | * {@link CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES android.control.awbAvailableModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1686 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1687 | * |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 1688 | * @see CaptureRequest#COLOR_CORRECTION_GAINS |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 1689 | * @see CaptureRequest#COLOR_CORRECTION_MODE |
| 1690 | * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM |
Yin-Chia Yeh | 7144b5d | 2014-11-12 11:42:49 -0800 | [diff] [blame] | 1691 | * @see CaptureRequest#CONTROL_AE_MODE |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1692 | * @see CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES |
Yin-Chia Yeh | 7144b5d | 2014-11-12 11:42:49 -0800 | [diff] [blame] | 1693 | * @see CaptureRequest#CONTROL_AWB_LOCK |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 1694 | * @see CaptureRequest#CONTROL_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1695 | * @see #CONTROL_AWB_MODE_OFF |
| 1696 | * @see #CONTROL_AWB_MODE_AUTO |
| 1697 | * @see #CONTROL_AWB_MODE_INCANDESCENT |
| 1698 | * @see #CONTROL_AWB_MODE_FLUORESCENT |
| 1699 | * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT |
| 1700 | * @see #CONTROL_AWB_MODE_DAYLIGHT |
| 1701 | * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT |
| 1702 | * @see #CONTROL_AWB_MODE_TWILIGHT |
| 1703 | * @see #CONTROL_AWB_MODE_SHADE |
| 1704 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1705 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1706 | public static final Key<Integer> CONTROL_AWB_MODE = |
| 1707 | new Key<Integer>("android.control.awbMode", int.class); |
| 1708 | |
| 1709 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1710 | * <p>List of metering areas to use for auto-white-balance illuminant |
Ruben Brunk | f59521d | 2014-02-03 17:14:33 -0800 | [diff] [blame] | 1711 | * estimation.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1712 | * <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] | 1713 | * Otherwise will always be present.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1714 | * <p>The maximum number of regions supported by the device is determined by the value |
| 1715 | * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb}.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1716 | * <p>The coordinate system is based on the active pixel array, |
Timothy Knight | 2629f27 | 2013-09-03 17:23:23 -0700 | [diff] [blame] | 1717 | * with (0,0) being the top-left pixel in the active pixel array, and |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1718 | * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1, |
| 1719 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the |
Yin-Chia Yeh | 97f1c85 | 2014-05-28 16:36:05 -0700 | [diff] [blame] | 1720 | * bottom-right pixel in the active pixel array.</p> |
| 1721 | * <p>The weight must range from 0 to 1000, and represents a weight |
| 1722 | * for every pixel in the area. This means that a large metering area |
| 1723 | * with the same weight as a smaller area will have more effect in |
| 1724 | * the metering result. Metering areas can partially overlap and the |
| 1725 | * camera device will add the weights in the overlap region.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1726 | * <p>The weights are relative to weights of other white balance metering regions, so if |
| 1727 | * only one region is used, all non-zero weights will have the same effect. A region with |
| 1728 | * 0 weight is ignored.</p> |
| 1729 | * <p>If all regions have 0 weight, then no specific metering area needs to be used by the |
| 1730 | * camera device.</p> |
| 1731 | * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in |
| 1732 | * capture result metadata, the camera device will ignore the sections outside the crop |
| 1733 | * region and output only the intersection rectangle as the metering region in the result |
| 1734 | * metadata. If the region is entirely outside the crop region, it will be ignored and |
| 1735 | * not reported in the result metadata.</p> |
| 1736 | * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p> |
| 1737 | * <p><b>Range of valid values:</b><br> |
| 1738 | * Coordinates must be between <code>[(0,0), (width, height))</code> of |
| 1739 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p> |
Yin-Chia Yeh | 808150f | 2014-09-08 15:48:47 -0700 | [diff] [blame] | 1740 | * <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] | 1741 | * |
Yin-Chia Yeh | 808150f | 2014-09-08 15:48:47 -0700 | [diff] [blame] | 1742 | * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AWB |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1743 | * @see CaptureRequest#SCALER_CROP_REGION |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 1744 | * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1745 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1746 | @PublicKey |
Yin-Chia Yeh | 817f893 | 2014-05-19 10:23:27 -0700 | [diff] [blame] | 1747 | public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS = |
| 1748 | 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] | 1749 | |
| 1750 | /** |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 1751 | * <p>Information to the camera device 3A (auto-exposure, |
| 1752 | * auto-focus, auto-white balance) routines about the purpose |
| 1753 | * of this capture, to help the camera device to decide optimal 3A |
| 1754 | * strategy.</p> |
| 1755 | * <p>This control (except for MANUAL) is only effective if |
| 1756 | * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF</code> and any 3A routine is active.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1757 | * <p>ZERO_SHUTTER_LAG will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} |
Chien-Yu Chen | 8062d31 | 2015-05-12 14:24:10 -0700 | [diff] [blame] | 1758 | * contains PRIVATE_REPROCESSING or YUV_REPROCESSING. MANUAL will be supported if |
Zhijun He | 513f7c3 | 2015-04-24 18:23:54 -0700 | [diff] [blame] | 1759 | * {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains MANUAL_SENSOR. Other intent values are |
| 1760 | * always supported.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1761 | * <p><b>Possible values:</b> |
| 1762 | * <ul> |
| 1763 | * <li>{@link #CONTROL_CAPTURE_INTENT_CUSTOM CUSTOM}</li> |
| 1764 | * <li>{@link #CONTROL_CAPTURE_INTENT_PREVIEW PREVIEW}</li> |
| 1765 | * <li>{@link #CONTROL_CAPTURE_INTENT_STILL_CAPTURE STILL_CAPTURE}</li> |
| 1766 | * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_RECORD VIDEO_RECORD}</li> |
| 1767 | * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT VIDEO_SNAPSHOT}</li> |
| 1768 | * <li>{@link #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li> |
| 1769 | * <li>{@link #CONTROL_CAPTURE_INTENT_MANUAL MANUAL}</li> |
| 1770 | * </ul></p> |
| 1771 | * <p>This key is available on all devices.</p> |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 1772 | * |
| 1773 | * @see CaptureRequest#CONTROL_MODE |
| 1774 | * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES |
| 1775 | * @see #CONTROL_CAPTURE_INTENT_CUSTOM |
| 1776 | * @see #CONTROL_CAPTURE_INTENT_PREVIEW |
| 1777 | * @see #CONTROL_CAPTURE_INTENT_STILL_CAPTURE |
| 1778 | * @see #CONTROL_CAPTURE_INTENT_VIDEO_RECORD |
| 1779 | * @see #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT |
| 1780 | * @see #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG |
| 1781 | * @see #CONTROL_CAPTURE_INTENT_MANUAL |
| 1782 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1783 | @PublicKey |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 1784 | public static final Key<Integer> CONTROL_CAPTURE_INTENT = |
| 1785 | new Key<Integer>("android.control.captureIntent", int.class); |
| 1786 | |
| 1787 | /** |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 1788 | * <p>Current state of auto-white balance (AWB) algorithm.</p> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 1789 | * <p>Switching between or enabling AWB modes ({@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}) always |
| 1790 | * resets the AWB state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode}, |
| 1791 | * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all |
| 1792 | * the algorithm states to INACTIVE.</p> |
| 1793 | * <p>The camera device can do several state transitions between two results, if it is |
| 1794 | * allowed by the state transition table. So INACTIVE may never actually be seen in |
| 1795 | * a result.</p> |
| 1796 | * <p>The state in the result is the state for this image (in sync with this image): if |
| 1797 | * AWB state becomes CONVERGED, then the image data associated with this result should |
| 1798 | * be good to use.</p> |
| 1799 | * <p>Below are state transition tables for different AWB modes.</p> |
| 1800 | * <p>When <code>{@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} != AWB_MODE_AUTO</code>:</p> |
| 1801 | * <table> |
| 1802 | * <thead> |
| 1803 | * <tr> |
| 1804 | * <th align="center">State</th> |
| 1805 | * <th align="center">Transition Cause</th> |
| 1806 | * <th align="center">New State</th> |
| 1807 | * <th align="center">Notes</th> |
| 1808 | * </tr> |
| 1809 | * </thead> |
| 1810 | * <tbody> |
| 1811 | * <tr> |
| 1812 | * <td align="center">INACTIVE</td> |
| 1813 | * <td align="center"></td> |
| 1814 | * <td align="center">INACTIVE</td> |
| 1815 | * <td align="center">Camera device auto white balance algorithm is disabled</td> |
| 1816 | * </tr> |
| 1817 | * </tbody> |
| 1818 | * </table> |
| 1819 | * <p>When {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is AWB_MODE_AUTO:</p> |
| 1820 | * <table> |
| 1821 | * <thead> |
| 1822 | * <tr> |
| 1823 | * <th align="center">State</th> |
| 1824 | * <th align="center">Transition Cause</th> |
| 1825 | * <th align="center">New State</th> |
| 1826 | * <th align="center">Notes</th> |
| 1827 | * </tr> |
| 1828 | * </thead> |
| 1829 | * <tbody> |
| 1830 | * <tr> |
| 1831 | * <td align="center">INACTIVE</td> |
| 1832 | * <td align="center">Camera device initiates AWB scan</td> |
| 1833 | * <td align="center">SEARCHING</td> |
| 1834 | * <td align="center">Values changing</td> |
| 1835 | * </tr> |
| 1836 | * <tr> |
| 1837 | * <td align="center">INACTIVE</td> |
| 1838 | * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td> |
| 1839 | * <td align="center">LOCKED</td> |
| 1840 | * <td align="center">Values locked</td> |
| 1841 | * </tr> |
| 1842 | * <tr> |
| 1843 | * <td align="center">SEARCHING</td> |
| 1844 | * <td align="center">Camera device finishes AWB scan</td> |
| 1845 | * <td align="center">CONVERGED</td> |
| 1846 | * <td align="center">Good values, not changing</td> |
| 1847 | * </tr> |
| 1848 | * <tr> |
| 1849 | * <td align="center">SEARCHING</td> |
| 1850 | * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td> |
| 1851 | * <td align="center">LOCKED</td> |
| 1852 | * <td align="center">Values locked</td> |
| 1853 | * </tr> |
| 1854 | * <tr> |
| 1855 | * <td align="center">CONVERGED</td> |
| 1856 | * <td align="center">Camera device initiates AWB scan</td> |
| 1857 | * <td align="center">SEARCHING</td> |
| 1858 | * <td align="center">Values changing</td> |
| 1859 | * </tr> |
| 1860 | * <tr> |
| 1861 | * <td align="center">CONVERGED</td> |
| 1862 | * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td> |
| 1863 | * <td align="center">LOCKED</td> |
| 1864 | * <td align="center">Values locked</td> |
| 1865 | * </tr> |
| 1866 | * <tr> |
| 1867 | * <td align="center">LOCKED</td> |
| 1868 | * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td> |
| 1869 | * <td align="center">SEARCHING</td> |
| 1870 | * <td align="center">Values not good after unlock</td> |
| 1871 | * </tr> |
Zhijun He | 60b19dc | 2014-02-24 10:19:20 -0800 | [diff] [blame] | 1872 | * </tbody> |
| 1873 | * </table> |
| 1874 | * <p>For the above table, the camera device may skip reporting any state changes that happen |
| 1875 | * without application intervention (i.e. mode switch, trigger, locking). Any state that |
| 1876 | * can be skipped in that manner is called a transient state.</p> |
| 1877 | * <p>For example, for this AWB mode (AWB_MODE_AUTO), in addition to the state transitions |
| 1878 | * listed in above table, it is also legal for the camera device to skip one or more |
| 1879 | * transient states between two results. See below table for examples:</p> |
| 1880 | * <table> |
| 1881 | * <thead> |
| 1882 | * <tr> |
| 1883 | * <th align="center">State</th> |
| 1884 | * <th align="center">Transition Cause</th> |
| 1885 | * <th align="center">New State</th> |
| 1886 | * <th align="center">Notes</th> |
| 1887 | * </tr> |
| 1888 | * </thead> |
| 1889 | * <tbody> |
| 1890 | * <tr> |
| 1891 | * <td align="center">INACTIVE</td> |
| 1892 | * <td align="center">Camera device finished AWB scan</td> |
| 1893 | * <td align="center">CONVERGED</td> |
| 1894 | * <td align="center">Values are already good, transient states are skipped by camera device.</td> |
| 1895 | * </tr> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 1896 | * <tr> |
| 1897 | * <td align="center">LOCKED</td> |
| 1898 | * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td> |
| 1899 | * <td align="center">CONVERGED</td> |
Zhijun He | 60b19dc | 2014-02-24 10:19:20 -0800 | [diff] [blame] | 1900 | * <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] | 1901 | * </tr> |
| 1902 | * </tbody> |
| 1903 | * </table> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1904 | * <p><b>Possible values:</b> |
| 1905 | * <ul> |
| 1906 | * <li>{@link #CONTROL_AWB_STATE_INACTIVE INACTIVE}</li> |
| 1907 | * <li>{@link #CONTROL_AWB_STATE_SEARCHING SEARCHING}</li> |
| 1908 | * <li>{@link #CONTROL_AWB_STATE_CONVERGED CONVERGED}</li> |
| 1909 | * <li>{@link #CONTROL_AWB_STATE_LOCKED LOCKED}</li> |
| 1910 | * </ul></p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1911 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 1912 | * <p><b>Limited capability</b> - |
| 1913 | * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the |
| 1914 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 1915 | * |
| 1916 | * @see CaptureRequest#CONTROL_AWB_LOCK |
| 1917 | * @see CaptureRequest#CONTROL_AWB_MODE |
| 1918 | * @see CaptureRequest#CONTROL_MODE |
| 1919 | * @see CaptureRequest#CONTROL_SCENE_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1920 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1921 | * @see #CONTROL_AWB_STATE_INACTIVE |
| 1922 | * @see #CONTROL_AWB_STATE_SEARCHING |
| 1923 | * @see #CONTROL_AWB_STATE_CONVERGED |
| 1924 | * @see #CONTROL_AWB_STATE_LOCKED |
| 1925 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1926 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1927 | public static final Key<Integer> CONTROL_AWB_STATE = |
| 1928 | new Key<Integer>("android.control.awbState", int.class); |
| 1929 | |
| 1930 | /** |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 1931 | * <p>A special color effect to apply.</p> |
| 1932 | * <p>When this mode is set, a color effect will be applied |
| 1933 | * to images produced by the camera device. The interpretation |
| 1934 | * and implementation of these color effects is left to the |
| 1935 | * implementor of the camera device, and should not be |
| 1936 | * depended on to be consistent (or present) across all |
| 1937 | * devices.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1938 | * <p><b>Possible values:</b> |
| 1939 | * <ul> |
| 1940 | * <li>{@link #CONTROL_EFFECT_MODE_OFF OFF}</li> |
| 1941 | * <li>{@link #CONTROL_EFFECT_MODE_MONO MONO}</li> |
| 1942 | * <li>{@link #CONTROL_EFFECT_MODE_NEGATIVE NEGATIVE}</li> |
| 1943 | * <li>{@link #CONTROL_EFFECT_MODE_SOLARIZE SOLARIZE}</li> |
| 1944 | * <li>{@link #CONTROL_EFFECT_MODE_SEPIA SEPIA}</li> |
| 1945 | * <li>{@link #CONTROL_EFFECT_MODE_POSTERIZE POSTERIZE}</li> |
| 1946 | * <li>{@link #CONTROL_EFFECT_MODE_WHITEBOARD WHITEBOARD}</li> |
| 1947 | * <li>{@link #CONTROL_EFFECT_MODE_BLACKBOARD BLACKBOARD}</li> |
| 1948 | * <li>{@link #CONTROL_EFFECT_MODE_AQUA AQUA}</li> |
| 1949 | * </ul></p> |
| 1950 | * <p><b>Available values for this device:</b><br> |
| 1951 | * {@link CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS android.control.availableEffects}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1952 | * <p>This key is available on all devices.</p> |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 1953 | * |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1954 | * @see CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 1955 | * @see #CONTROL_EFFECT_MODE_OFF |
| 1956 | * @see #CONTROL_EFFECT_MODE_MONO |
| 1957 | * @see #CONTROL_EFFECT_MODE_NEGATIVE |
| 1958 | * @see #CONTROL_EFFECT_MODE_SOLARIZE |
| 1959 | * @see #CONTROL_EFFECT_MODE_SEPIA |
| 1960 | * @see #CONTROL_EFFECT_MODE_POSTERIZE |
| 1961 | * @see #CONTROL_EFFECT_MODE_WHITEBOARD |
| 1962 | * @see #CONTROL_EFFECT_MODE_BLACKBOARD |
| 1963 | * @see #CONTROL_EFFECT_MODE_AQUA |
| 1964 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1965 | @PublicKey |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 1966 | public static final Key<Integer> CONTROL_EFFECT_MODE = |
| 1967 | new Key<Integer>("android.control.effectMode", int.class); |
| 1968 | |
| 1969 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1970 | * <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] | 1971 | * routines.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1972 | * <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] | 1973 | * 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] | 1974 | * capture parameters itself.</p> |
| 1975 | * <p>When set to AUTO, the individual algorithm controls in |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1976 | * 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] | 1977 | * <p>When set to USE_SCENE_MODE, the individual controls in |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 1978 | * android.control.* are mostly disabled, and the camera device implements |
Zhijun He | f353742 | 2013-12-16 16:56:35 -0800 | [diff] [blame] | 1979 | * one of the scene mode settings (such as ACTION, SUNSET, or PARTY) |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 1980 | * as it wishes. The camera device scene mode 3A settings are provided by |
Zhijun He | 527d522 | 2015-05-14 15:36:04 -0700 | [diff] [blame] | 1981 | * {@link android.hardware.camera2.CaptureResult capture results}.</p> |
Zhijun He | 2d5e897 | 2014-02-07 16:13:46 -0800 | [diff] [blame] | 1982 | * <p>When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference |
| 1983 | * is that this frame will not be used by camera device background 3A statistics |
| 1984 | * update, as if this frame is never captured. This mode can be used in the scenario |
| 1985 | * where the application doesn't want a 3A manual control capture to affect |
| 1986 | * the subsequent auto 3A capture results.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1987 | * <p><b>Possible values:</b> |
| 1988 | * <ul> |
| 1989 | * <li>{@link #CONTROL_MODE_OFF OFF}</li> |
| 1990 | * <li>{@link #CONTROL_MODE_AUTO AUTO}</li> |
| 1991 | * <li>{@link #CONTROL_MODE_USE_SCENE_MODE USE_SCENE_MODE}</li> |
| 1992 | * <li>{@link #CONTROL_MODE_OFF_KEEP_STATE OFF_KEEP_STATE}</li> |
| 1993 | * </ul></p> |
Yin-Chia Yeh | d9fc67c | 2015-01-30 10:47:22 -0800 | [diff] [blame] | 1994 | * <p><b>Available values for this device:</b><br> |
| 1995 | * {@link CameraCharacteristics#CONTROL_AVAILABLE_MODES android.control.availableModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1996 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1997 | * |
| 1998 | * @see CaptureRequest#CONTROL_AF_MODE |
Yin-Chia Yeh | d9fc67c | 2015-01-30 10:47:22 -0800 | [diff] [blame] | 1999 | * @see CameraCharacteristics#CONTROL_AVAILABLE_MODES |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2000 | * @see #CONTROL_MODE_OFF |
| 2001 | * @see #CONTROL_MODE_AUTO |
| 2002 | * @see #CONTROL_MODE_USE_SCENE_MODE |
Zhijun He | 2d5e897 | 2014-02-07 16:13:46 -0800 | [diff] [blame] | 2003 | * @see #CONTROL_MODE_OFF_KEEP_STATE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2004 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2005 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2006 | public static final Key<Integer> CONTROL_MODE = |
| 2007 | new Key<Integer>("android.control.mode", int.class); |
| 2008 | |
| 2009 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2010 | * <p>Control for which scene mode is currently active.</p> |
| 2011 | * <p>Scene modes are custom camera modes optimized for a certain set of conditions and |
| 2012 | * capture settings.</p> |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 2013 | * <p>This is the mode that that is active when |
Zhijun He | ee2ebde | 2015-06-16 19:58:11 -0700 | [diff] [blame] | 2014 | * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code>. Aside from FACE_PRIORITY, these modes will |
| 2015 | * 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} |
| 2016 | * while in use.</p> |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 2017 | * <p>The interpretation and implementation of these scene modes is left |
| 2018 | * to the implementor of the camera device. Their behavior will not be |
| 2019 | * consistent across all devices, and any given device may only implement |
| 2020 | * a subset of these modes.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2021 | * <p><b>Possible values:</b> |
| 2022 | * <ul> |
| 2023 | * <li>{@link #CONTROL_SCENE_MODE_DISABLED DISABLED}</li> |
| 2024 | * <li>{@link #CONTROL_SCENE_MODE_FACE_PRIORITY FACE_PRIORITY}</li> |
| 2025 | * <li>{@link #CONTROL_SCENE_MODE_ACTION ACTION}</li> |
| 2026 | * <li>{@link #CONTROL_SCENE_MODE_PORTRAIT PORTRAIT}</li> |
| 2027 | * <li>{@link #CONTROL_SCENE_MODE_LANDSCAPE LANDSCAPE}</li> |
| 2028 | * <li>{@link #CONTROL_SCENE_MODE_NIGHT NIGHT}</li> |
| 2029 | * <li>{@link #CONTROL_SCENE_MODE_NIGHT_PORTRAIT NIGHT_PORTRAIT}</li> |
| 2030 | * <li>{@link #CONTROL_SCENE_MODE_THEATRE THEATRE}</li> |
| 2031 | * <li>{@link #CONTROL_SCENE_MODE_BEACH BEACH}</li> |
| 2032 | * <li>{@link #CONTROL_SCENE_MODE_SNOW SNOW}</li> |
| 2033 | * <li>{@link #CONTROL_SCENE_MODE_SUNSET SUNSET}</li> |
| 2034 | * <li>{@link #CONTROL_SCENE_MODE_STEADYPHOTO STEADYPHOTO}</li> |
| 2035 | * <li>{@link #CONTROL_SCENE_MODE_FIREWORKS FIREWORKS}</li> |
| 2036 | * <li>{@link #CONTROL_SCENE_MODE_SPORTS SPORTS}</li> |
| 2037 | * <li>{@link #CONTROL_SCENE_MODE_PARTY PARTY}</li> |
| 2038 | * <li>{@link #CONTROL_SCENE_MODE_CANDLELIGHT CANDLELIGHT}</li> |
| 2039 | * <li>{@link #CONTROL_SCENE_MODE_BARCODE BARCODE}</li> |
| 2040 | * <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] | 2041 | * <li>{@link #CONTROL_SCENE_MODE_HDR HDR}</li> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2042 | * </ul></p> |
| 2043 | * <p><b>Available values for this device:</b><br> |
| 2044 | * {@link CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES android.control.availableSceneModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2045 | * <p>This key is available on all devices.</p> |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 2046 | * |
| 2047 | * @see CaptureRequest#CONTROL_AE_MODE |
| 2048 | * @see CaptureRequest#CONTROL_AF_MODE |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 2049 | * @see CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 2050 | * @see CaptureRequest#CONTROL_AWB_MODE |
| 2051 | * @see CaptureRequest#CONTROL_MODE |
| 2052 | * @see #CONTROL_SCENE_MODE_DISABLED |
| 2053 | * @see #CONTROL_SCENE_MODE_FACE_PRIORITY |
| 2054 | * @see #CONTROL_SCENE_MODE_ACTION |
| 2055 | * @see #CONTROL_SCENE_MODE_PORTRAIT |
| 2056 | * @see #CONTROL_SCENE_MODE_LANDSCAPE |
| 2057 | * @see #CONTROL_SCENE_MODE_NIGHT |
| 2058 | * @see #CONTROL_SCENE_MODE_NIGHT_PORTRAIT |
| 2059 | * @see #CONTROL_SCENE_MODE_THEATRE |
| 2060 | * @see #CONTROL_SCENE_MODE_BEACH |
| 2061 | * @see #CONTROL_SCENE_MODE_SNOW |
| 2062 | * @see #CONTROL_SCENE_MODE_SUNSET |
| 2063 | * @see #CONTROL_SCENE_MODE_STEADYPHOTO |
| 2064 | * @see #CONTROL_SCENE_MODE_FIREWORKS |
| 2065 | * @see #CONTROL_SCENE_MODE_SPORTS |
| 2066 | * @see #CONTROL_SCENE_MODE_PARTY |
| 2067 | * @see #CONTROL_SCENE_MODE_CANDLELIGHT |
| 2068 | * @see #CONTROL_SCENE_MODE_BARCODE |
Zhijun He | e040418 | 2014-06-26 13:17:09 -0700 | [diff] [blame] | 2069 | * @see #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO |
Eino-Ville Talvala | f4eac12 | 2014-12-05 11:10:15 -0800 | [diff] [blame] | 2070 | * @see #CONTROL_SCENE_MODE_HDR |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 2071 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2072 | @PublicKey |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 2073 | public static final Key<Integer> CONTROL_SCENE_MODE = |
| 2074 | new Key<Integer>("android.control.sceneMode", int.class); |
| 2075 | |
| 2076 | /** |
| 2077 | * <p>Whether video stabilization is |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 2078 | * active.</p> |
Jianing Wei | 2813b0f | 2015-09-29 14:24:36 -0700 | [diff] [blame] | 2079 | * <p>Video stabilization automatically warps images from |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2080 | * the camera in order to stabilize motion between consecutive frames.</p> |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 2081 | * <p>If enabled, video stabilization can modify the |
Zhijun He | 45fa43a1 | 2014-06-13 18:29:37 -0700 | [diff] [blame] | 2082 | * {@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] | 2083 | * <p>Switching between different video stabilization modes may take several |
| 2084 | * frames to initialize, the camera device will report the current mode |
| 2085 | * in capture result metadata. For example, When "ON" mode is requested, |
| 2086 | * the video stabilization modes in the first several capture results may |
| 2087 | * still be "OFF", and it will become "ON" when the initialization is |
| 2088 | * done.</p> |
Jianing Wei | 2813b0f | 2015-09-29 14:24:36 -0700 | [diff] [blame] | 2089 | * <p>In addition, not all recording sizes or frame rates may be supported for |
| 2090 | * stabilization by a device that reports stabilization support. It is guaranteed |
| 2091 | * that an output targeting a MediaRecorder or MediaCodec will be stabilized if |
| 2092 | * the recording resolution is less than or equal to 1920 x 1080 (width less than |
| 2093 | * or equal to 1920, height less than or equal to 1080), and the recording |
| 2094 | * frame rate is less than or equal to 30fps. At other sizes, the CaptureResult |
| 2095 | * {@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode} field will return |
| 2096 | * OFF if the recording output is not stabilized, or if there are no output |
| 2097 | * Surface types that can be stabilized.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2098 | * <p>If a camera device supports both this mode and OIS |
| 2099 | * ({@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}), turning both modes on may |
| 2100 | * produce undesirable interaction, so it is recommended not to enable |
| 2101 | * both at the same time.</p> |
| 2102 | * <p><b>Possible values:</b> |
| 2103 | * <ul> |
| 2104 | * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_OFF OFF}</li> |
| 2105 | * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_ON ON}</li> |
| 2106 | * </ul></p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2107 | * <p>This key is available on all devices.</p> |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 2108 | * |
Jianing Wei | 2813b0f | 2015-09-29 14:24:36 -0700 | [diff] [blame] | 2109 | * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE |
Zhijun He | 45fa43a1 | 2014-06-13 18:29:37 -0700 | [diff] [blame] | 2110 | * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 2111 | * @see CaptureRequest#SCALER_CROP_REGION |
| 2112 | * @see #CONTROL_VIDEO_STABILIZATION_MODE_OFF |
| 2113 | * @see #CONTROL_VIDEO_STABILIZATION_MODE_ON |
| 2114 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2115 | @PublicKey |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 2116 | public static final Key<Integer> CONTROL_VIDEO_STABILIZATION_MODE = |
| 2117 | new Key<Integer>("android.control.videoStabilizationMode", int.class); |
| 2118 | |
| 2119 | /** |
Yin-Chia Yeh | 33052d3 | 2016-04-11 16:39:02 -0700 | [diff] [blame] | 2120 | * <p>The amount of additional sensitivity boost applied to output images |
Yin-Chia Yeh | 1ee1a0a | 2016-01-18 19:13:47 -0800 | [diff] [blame] | 2121 | * after RAW sensor data is captured.</p> |
| 2122 | * <p>Some camera devices support additional digital sensitivity boosting in the |
| 2123 | * camera processing pipeline after sensor RAW image is captured. |
| 2124 | * Such a boost will be applied to YUV/JPEG format output images but will not |
| 2125 | * 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] | 2126 | * <p>This key will be <code>null</code> for devices that do not support any RAW format |
| 2127 | * outputs. For devices that do support RAW format outputs, this key will always |
| 2128 | * present, and if a device does not support post RAW sensitivity boost, it will |
| 2129 | * list <code>100</code> in this key.</p> |
Yin-Chia Yeh | 1ee1a0a | 2016-01-18 19:13:47 -0800 | [diff] [blame] | 2130 | * <p>If the camera device cannot apply the exact boost requested, it will reduce the |
| 2131 | * boost to the nearest supported value. |
| 2132 | * The final boost value used will be available in the output capture result.</p> |
| 2133 | * <p>For devices that support post RAW sensitivity boost, the YUV/JPEG output images |
| 2134 | * of such device will have the total sensitivity of |
Yin-Chia Yeh | 67e61b6 | 2016-01-26 13:27:35 -0800 | [diff] [blame] | 2135 | * <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] | 2136 | * The sensitivity of RAW format images will always be <code>{@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}</code></p> |
| 2137 | * <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 |
| 2138 | * OFF; otherwise the auto-exposure algorithm will override this value.</p> |
| 2139 | * <p><b>Units</b>: ISO arithmetic units, the same as {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}</p> |
| 2140 | * <p><b>Range of valid values:</b><br> |
| 2141 | * {@link CameraCharacteristics#CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE android.control.postRawSensitivityBoostRange}</p> |
| 2142 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2143 | * |
| 2144 | * @see CaptureRequest#CONTROL_AE_MODE |
| 2145 | * @see CaptureRequest#CONTROL_MODE |
| 2146 | * @see CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST |
| 2147 | * @see CameraCharacteristics#CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE |
| 2148 | * @see CaptureRequest#SENSOR_SENSITIVITY |
| 2149 | */ |
| 2150 | @PublicKey |
| 2151 | public static final Key<Integer> CONTROL_POST_RAW_SENSITIVITY_BOOST = |
| 2152 | new Key<Integer>("android.control.postRawSensitivityBoost", int.class); |
| 2153 | |
| 2154 | /** |
Chien-Yu Chen | e449171 | 2017-01-11 11:14:06 -0800 | [diff] [blame] | 2155 | * <p>Allow camera device to enable zero-shutter-lag mode for requests with |
| 2156 | * {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} == STILL_CAPTURE.</p> |
| 2157 | * <p>If enableZsl is <code>true</code>, the camera device may enable zero-shutter-lag mode for requests with |
| 2158 | * STILL_CAPTURE capture intent. The camera device may use images captured in the past to |
| 2159 | * produce output images for a zero-shutter-lag request. The result metadata including the |
| 2160 | * {@link CaptureResult#SENSOR_TIMESTAMP android.sensor.timestamp} reflects the source frames used to produce output images. |
| 2161 | * Therefore, the contents of the output images and the result metadata may be out of order |
| 2162 | * compared to previous regular requests. enableZsl does not affect requests with other |
| 2163 | * capture intents.</p> |
| 2164 | * <p>For example, when requests are submitted in the following order: |
| 2165 | * Request A: enableZsl is ON, {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} is PREVIEW |
| 2166 | * Request B: enableZsl is ON, {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} is STILL_CAPTURE</p> |
| 2167 | * <p>The output images for request B may have contents captured before the output images for |
| 2168 | * request A, and the result metadata for request B may be older than the result metadata for |
| 2169 | * request A.</p> |
| 2170 | * <p>Note that when enableZsl is <code>true</code>, it is not guaranteed to get output images captured in the |
| 2171 | * past for requests with STILL_CAPTURE capture intent.</p> |
| 2172 | * <p>The value of enableZsl in capture templates is always <code>false</code> if present.</p> |
| 2173 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2174 | * |
| 2175 | * @see CaptureRequest#CONTROL_CAPTURE_INTENT |
| 2176 | * @see CaptureResult#SENSOR_TIMESTAMP |
| 2177 | */ |
| 2178 | @PublicKey |
| 2179 | public static final Key<Boolean> CONTROL_ENABLE_ZSL = |
| 2180 | new Key<Boolean>("android.control.enableZsl", boolean.class); |
| 2181 | |
| 2182 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2183 | * <p>Operation mode for edge |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 2184 | * enhancement.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2185 | * <p>Edge enhancement improves sharpness and details in the captured image. OFF means |
| 2186 | * no enhancement will be applied by the camera device.</p> |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 2187 | * <p>FAST/HIGH_QUALITY both mean camera device determined enhancement |
Zhijun He | 2807936 | 2013-12-17 10:35:40 -0800 | [diff] [blame] | 2188 | * will be applied. HIGH_QUALITY mode indicates that the |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 2189 | * camera device will use the highest-quality enhancement algorithms, |
| 2190 | * 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] | 2191 | * not slow down capture rate when applying edge enhancement. FAST may be the same as OFF if |
| 2192 | * edge enhancement will slow down capture rate. Every output stream will have a similar |
| 2193 | * amount of enhancement applied.</p> |
Eino-Ville Talvala | 0dd1750 | 2015-07-07 10:43:07 -0700 | [diff] [blame] | 2194 | * <p>ZERO_SHUTTER_LAG is meant to be used by applications that maintain a continuous circular |
| 2195 | * buffer of high-resolution images during preview and reprocess image(s) from that buffer |
| 2196 | * into a final capture when triggered by the user. In this mode, the camera device applies |
| 2197 | * edge enhancement to low-resolution streams (below maximum recording resolution) to |
| 2198 | * maximize preview quality, but does not apply edge enhancement to high-resolution streams, |
| 2199 | * since those will be reprocessed later if necessary.</p> |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 2200 | * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera |
| 2201 | * device will apply FAST/HIGH_QUALITY YUV-domain edge enhancement, respectively. |
Chien-Yu Chen | 9c9167e | 2015-07-14 16:38:25 -0700 | [diff] [blame] | 2202 | * The camera device may adjust its internal edge enhancement parameters for best |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 2203 | * 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] | 2204 | * <p><b>Possible values:</b> |
| 2205 | * <ul> |
| 2206 | * <li>{@link #EDGE_MODE_OFF OFF}</li> |
| 2207 | * <li>{@link #EDGE_MODE_FAST FAST}</li> |
| 2208 | * <li>{@link #EDGE_MODE_HIGH_QUALITY HIGH_QUALITY}</li> |
Eino-Ville Talvala | 0dd1750 | 2015-07-07 10:43:07 -0700 | [diff] [blame] | 2209 | * <li>{@link #EDGE_MODE_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2210 | * </ul></p> |
| 2211 | * <p><b>Available values for this device:</b><br> |
| 2212 | * {@link CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES android.edge.availableEdgeModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2213 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2214 | * <p><b>Full capability</b> - |
| 2215 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 2216 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Ruben Brunk | 6dc379c | 2014-03-04 15:04:00 -0800 | [diff] [blame] | 2217 | * |
| 2218 | * @see CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2219 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 2220 | * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2221 | * @see #EDGE_MODE_OFF |
| 2222 | * @see #EDGE_MODE_FAST |
| 2223 | * @see #EDGE_MODE_HIGH_QUALITY |
Eino-Ville Talvala | 0dd1750 | 2015-07-07 10:43:07 -0700 | [diff] [blame] | 2224 | * @see #EDGE_MODE_ZERO_SHUTTER_LAG |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2225 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2226 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2227 | public static final Key<Integer> EDGE_MODE = |
| 2228 | new Key<Integer>("android.edge.mode", int.class); |
| 2229 | |
| 2230 | /** |
Zhijun He | 66d065a | 2014-01-16 18:18:50 -0800 | [diff] [blame] | 2231 | * <p>The desired mode for for the camera device's flash control.</p> |
| 2232 | * <p>This control is only effective when flash unit is available |
Zhijun He | 153ac10 | 2014-02-03 12:25:12 -0800 | [diff] [blame] | 2233 | * (<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] | 2234 | * <p>When this control is used, the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} must be set to ON or OFF. |
| 2235 | * Otherwise, the camera device auto-exposure related flash control (ON_AUTO_FLASH, |
| 2236 | * ON_ALWAYS_FLASH, or ON_AUTO_FLASH_REDEYE) will override this control.</p> |
| 2237 | * <p>When set to OFF, the camera device will not fire flash for this capture.</p> |
| 2238 | * <p>When set to SINGLE, the camera device will fire flash regardless of the camera |
| 2239 | * 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] | 2240 | * control should be used along with auto-exposure (AE) precapture metering sequence |
Zhijun He | 66d065a | 2014-01-16 18:18:50 -0800 | [diff] [blame] | 2241 | * ({@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}), otherwise, the image may be incorrectly exposed.</p> |
| 2242 | * <p>When set to TORCH, the flash will be on continuously. This mode can be used |
| 2243 | * 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] | 2244 | * <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] | 2245 | * <p><b>Possible values:</b> |
| 2246 | * <ul> |
| 2247 | * <li>{@link #FLASH_MODE_OFF OFF}</li> |
| 2248 | * <li>{@link #FLASH_MODE_SINGLE SINGLE}</li> |
| 2249 | * <li>{@link #FLASH_MODE_TORCH TORCH}</li> |
| 2250 | * </ul></p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2251 | * <p>This key is available on all devices.</p> |
Zhijun He | 66d065a | 2014-01-16 18:18:50 -0800 | [diff] [blame] | 2252 | * |
| 2253 | * @see CaptureRequest#CONTROL_AE_MODE |
| 2254 | * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER |
| 2255 | * @see CameraCharacteristics#FLASH_INFO_AVAILABLE |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 2256 | * @see CaptureResult#FLASH_STATE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2257 | * @see #FLASH_MODE_OFF |
| 2258 | * @see #FLASH_MODE_SINGLE |
| 2259 | * @see #FLASH_MODE_TORCH |
| 2260 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2261 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2262 | public static final Key<Integer> FLASH_MODE = |
| 2263 | new Key<Integer>("android.flash.mode", int.class); |
| 2264 | |
| 2265 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2266 | * <p>Current state of the flash |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 2267 | * unit.</p> |
| 2268 | * <p>When the camera device doesn't have flash unit |
| 2269 | * (i.e. <code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == false</code>), this state will always be UNAVAILABLE. |
| 2270 | * Other states indicate the current flash status.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2271 | * <p>In certain conditions, this will be available on LEGACY devices:</p> |
| 2272 | * <ul> |
| 2273 | * <li>Flash-less cameras always return UNAVAILABLE.</li> |
| 2274 | * <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] | 2275 | * will always return FIRED.</li> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2276 | * <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] | 2277 | * will always return FIRED.</li> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2278 | * </ul> |
| 2279 | * <p>In all other conditions the state will not be available on |
| 2280 | * LEGACY devices (i.e. it will be <code>null</code>).</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2281 | * <p><b>Possible values:</b> |
| 2282 | * <ul> |
| 2283 | * <li>{@link #FLASH_STATE_UNAVAILABLE UNAVAILABLE}</li> |
| 2284 | * <li>{@link #FLASH_STATE_CHARGING CHARGING}</li> |
| 2285 | * <li>{@link #FLASH_STATE_READY READY}</li> |
| 2286 | * <li>{@link #FLASH_STATE_FIRED FIRED}</li> |
| 2287 | * <li>{@link #FLASH_STATE_PARTIAL PARTIAL}</li> |
| 2288 | * </ul></p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2289 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2290 | * <p><b>Limited capability</b> - |
| 2291 | * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the |
| 2292 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 2293 | * |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2294 | * @see CaptureRequest#CONTROL_AE_MODE |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 2295 | * @see CameraCharacteristics#FLASH_INFO_AVAILABLE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2296 | * @see CaptureRequest#FLASH_MODE |
| 2297 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2298 | * @see #FLASH_STATE_UNAVAILABLE |
| 2299 | * @see #FLASH_STATE_CHARGING |
| 2300 | * @see #FLASH_STATE_READY |
| 2301 | * @see #FLASH_STATE_FIRED |
Zhijun He | 8dda727 | 2014-03-25 13:49:30 -0700 | [diff] [blame] | 2302 | * @see #FLASH_STATE_PARTIAL |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2303 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2304 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2305 | public static final Key<Integer> FLASH_STATE = |
| 2306 | new Key<Integer>("android.flash.state", int.class); |
| 2307 | |
| 2308 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2309 | * <p>Operational mode for hot pixel correction.</p> |
Ruben Brunk | eba1b3a | 2014-02-07 18:23:50 -0800 | [diff] [blame] | 2310 | * <p>Hotpixel correction interpolates out, or otherwise removes, pixels |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2311 | * that do not accurately measure the incoming light (i.e. pixels that |
| 2312 | * are stuck at an arbitrary value or are oversensitive).</p> |
| 2313 | * <p><b>Possible values:</b> |
| 2314 | * <ul> |
| 2315 | * <li>{@link #HOT_PIXEL_MODE_OFF OFF}</li> |
| 2316 | * <li>{@link #HOT_PIXEL_MODE_FAST FAST}</li> |
| 2317 | * <li>{@link #HOT_PIXEL_MODE_HIGH_QUALITY HIGH_QUALITY}</li> |
| 2318 | * </ul></p> |
| 2319 | * <p><b>Available values for this device:</b><br> |
| 2320 | * {@link CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES android.hotPixel.availableHotPixelModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2321 | * <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] | 2322 | * |
| 2323 | * @see CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES |
Ruben Brunk | eba1b3a | 2014-02-07 18:23:50 -0800 | [diff] [blame] | 2324 | * @see #HOT_PIXEL_MODE_OFF |
| 2325 | * @see #HOT_PIXEL_MODE_FAST |
| 2326 | * @see #HOT_PIXEL_MODE_HIGH_QUALITY |
| 2327 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2328 | @PublicKey |
Ruben Brunk | eba1b3a | 2014-02-07 18:23:50 -0800 | [diff] [blame] | 2329 | public static final Key<Integer> HOT_PIXEL_MODE = |
| 2330 | new Key<Integer>("android.hotPixel.mode", int.class); |
| 2331 | |
| 2332 | /** |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 2333 | * <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] | 2334 | * <p>Setting a location object in a request will include the GPS coordinates of the location |
| 2335 | * into any JPEG images captured based on the request. These coordinates can then be |
| 2336 | * viewed by anyone who receives the JPEG image.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2337 | * <p>This key is available on all devices.</p> |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 2338 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2339 | @PublicKey |
| 2340 | @SyntheticKey |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 2341 | public static final Key<android.location.Location> JPEG_GPS_LOCATION = |
| 2342 | new Key<android.location.Location>("android.jpeg.gpsLocation", android.location.Location.class); |
| 2343 | |
| 2344 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2345 | * <p>GPS coordinates to include in output JPEG |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2346 | * EXIF.</p> |
| 2347 | * <p><b>Range of valid values:</b><br> |
| 2348 | * (-180 - 180], [-90,90], [-inf, inf]</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2349 | * <p>This key is available on all devices.</p> |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 2350 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2351 | */ |
| 2352 | public static final Key<double[]> JPEG_GPS_COORDINATES = |
| 2353 | new Key<double[]>("android.jpeg.gpsCoordinates", double[].class); |
| 2354 | |
| 2355 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2356 | * <p>32 characters describing GPS algorithm to |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2357 | * include in EXIF.</p> |
| 2358 | * <p><b>Units</b>: UTF-8 null-terminated string</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2359 | * <p>This key is available on all devices.</p> |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 2360 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2361 | */ |
| 2362 | public static final Key<String> JPEG_GPS_PROCESSING_METHOD = |
| 2363 | new Key<String>("android.jpeg.gpsProcessingMethod", String.class); |
| 2364 | |
| 2365 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2366 | * <p>Time GPS fix was made to include in |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2367 | * EXIF.</p> |
| 2368 | * <p><b>Units</b>: UTC in seconds since January 1, 1970</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2369 | * <p>This key is available on all devices.</p> |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 2370 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2371 | */ |
| 2372 | public static final Key<Long> JPEG_GPS_TIMESTAMP = |
| 2373 | new Key<Long>("android.jpeg.gpsTimestamp", long.class); |
| 2374 | |
| 2375 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2376 | * <p>The orientation for a JPEG image.</p> |
| 2377 | * <p>The clockwise rotation angle in degrees, relative to the orientation |
| 2378 | * to the camera, that the JPEG picture needs to be rotated by, to be viewed |
| 2379 | * upright.</p> |
| 2380 | * <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] | 2381 | * rotate the image data to match this orientation. When the image data is rotated, |
| 2382 | * the thumbnail data will also be rotated.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2383 | * <p>Note that this orientation is relative to the orientation of the camera sensor, given |
| 2384 | * by {@link CameraCharacteristics#SENSOR_ORIENTATION android.sensor.orientation}.</p> |
| 2385 | * <p>To translate from the device orientation given by the Android sensor APIs, the following |
| 2386 | * sample code may be used:</p> |
| 2387 | * <pre><code>private int getJpegOrientation(CameraCharacteristics c, int deviceOrientation) { |
| 2388 | * if (deviceOrientation == android.view.OrientationEventListener.ORIENTATION_UNKNOWN) return 0; |
| 2389 | * int sensorOrientation = c.get(CameraCharacteristics.SENSOR_ORIENTATION); |
| 2390 | * |
| 2391 | * // Round device orientation to a multiple of 90 |
| 2392 | * deviceOrientation = (deviceOrientation + 45) / 90 * 90; |
| 2393 | * |
| 2394 | * // Reverse device orientation for front-facing cameras |
| 2395 | * boolean facingFront = c.get(CameraCharacteristics.LENS_FACING) == CameraCharacteristics.LENS_FACING_FRONT; |
| 2396 | * if (facingFront) deviceOrientation = -deviceOrientation; |
| 2397 | * |
| 2398 | * // Calculate desired JPEG orientation relative to camera orientation to make |
| 2399 | * // the image upright relative to the device orientation |
| 2400 | * int jpegOrientation = (sensorOrientation + deviceOrientation + 360) % 360; |
| 2401 | * |
| 2402 | * return jpegOrientation; |
| 2403 | * } |
| 2404 | * </code></pre> |
| 2405 | * <p><b>Units</b>: Degrees in multiples of 90</p> |
| 2406 | * <p><b>Range of valid values:</b><br> |
| 2407 | * 0, 90, 180, 270</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2408 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2409 | * |
| 2410 | * @see CameraCharacteristics#SENSOR_ORIENTATION |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2411 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2412 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2413 | public static final Key<Integer> JPEG_ORIENTATION = |
| 2414 | new Key<Integer>("android.jpeg.orientation", int.class); |
| 2415 | |
| 2416 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2417 | * <p>Compression quality of the final JPEG |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 2418 | * image.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 2419 | * <p>85-95 is typical usage range.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2420 | * <p><b>Range of valid values:</b><br> |
| 2421 | * 1-100; larger is higher quality</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2422 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2423 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2424 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2425 | public static final Key<Byte> JPEG_QUALITY = |
| 2426 | new Key<Byte>("android.jpeg.quality", byte.class); |
| 2427 | |
| 2428 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2429 | * <p>Compression quality of JPEG |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 2430 | * thumbnail.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2431 | * <p><b>Range of valid values:</b><br> |
| 2432 | * 1-100; larger is higher quality</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2433 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2434 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2435 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2436 | public static final Key<Byte> JPEG_THUMBNAIL_QUALITY = |
| 2437 | new Key<Byte>("android.jpeg.thumbnailQuality", byte.class); |
| 2438 | |
| 2439 | /** |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 2440 | * <p>Resolution of embedded JPEG thumbnail.</p> |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 2441 | * <p>When set to (0, 0) value, the JPEG EXIF will not contain thumbnail, |
| 2442 | * but the captured JPEG will still be a valid image.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2443 | * <p>For best results, when issuing a request for a JPEG image, the thumbnail size selected |
| 2444 | * should have the same aspect ratio as the main JPEG output.</p> |
Zhijun He | 50f7243 | 2014-05-28 13:52:04 -0700 | [diff] [blame] | 2445 | * <p>If the thumbnail image aspect ratio differs from the JPEG primary image aspect |
| 2446 | * ratio, the camera device creates the thumbnail by cropping it from the primary image. |
| 2447 | * For example, if the primary image has 4:3 aspect ratio, the thumbnail image has |
| 2448 | * 16:9 aspect ratio, the primary image will be cropped vertically (letterbox) to |
| 2449 | * generate the thumbnail image. The thumbnail image will always have a smaller Field |
| 2450 | * 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] | 2451 | * <p>When an {@link CaptureRequest#JPEG_ORIENTATION android.jpeg.orientation} of non-zero degree is requested, |
| 2452 | * the camera device will handle thumbnail rotation in one of the following ways:</p> |
| 2453 | * <ul> |
| 2454 | * <li>Set the {@link android.media.ExifInterface#TAG_ORIENTATION EXIF orientation flag} |
| 2455 | * and keep jpeg and thumbnail image data unrotated.</li> |
| 2456 | * <li>Rotate the jpeg and thumbnail image data and not set |
| 2457 | * {@link android.media.ExifInterface#TAG_ORIENTATION EXIF orientation flag}. In this |
| 2458 | * case, LIMITED or FULL hardware level devices will report rotated thumnail size in |
| 2459 | * capture result, so the width and height will be interchanged if 90 or 270 degree |
| 2460 | * orientation is requested. LEGACY device will always report unrotated thumbnail |
| 2461 | * size.</li> |
| 2462 | * </ul> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2463 | * <p><b>Range of valid values:</b><br> |
| 2464 | * {@link CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES android.jpeg.availableThumbnailSizes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2465 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2466 | * |
| 2467 | * @see CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES |
Yin-Chia Yeh | 5988311 | 2015-06-22 15:51:40 -0700 | [diff] [blame] | 2468 | * @see CaptureRequest#JPEG_ORIENTATION |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2469 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2470 | @PublicKey |
Igor Murashkin | 72f9f0a | 2014-05-14 15:46:10 -0700 | [diff] [blame] | 2471 | public static final Key<android.util.Size> JPEG_THUMBNAIL_SIZE = |
| 2472 | 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] | 2473 | |
| 2474 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2475 | * <p>The desired lens aperture size, as a ratio of lens focal length to the |
| 2476 | * effective aperture diameter.</p> |
| 2477 | * <p>Setting this value is only supported on the camera devices that have a variable |
| 2478 | * aperture lens.</p> |
Zhijun He | fb46c64 | 2014-01-14 17:57:23 -0800 | [diff] [blame] | 2479 | * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF, |
| 2480 | * 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] | 2481 | * {@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] | 2482 | * to achieve manual exposure control.</p> |
| 2483 | * <p>The requested aperture value may take several frames to reach the |
| 2484 | * requested value; the camera device will report the current (intermediate) |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 2485 | * aperture size in capture result metadata while the aperture is changing. |
| 2486 | * 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] | 2487 | * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of |
| 2488 | * the ON modes, this will be overridden by the camera device |
| 2489 | * auto-exposure algorithm, the overridden values are then provided |
| 2490 | * back to the user in the corresponding result.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2491 | * <p><b>Units</b>: The f-number (f/N)</p> |
| 2492 | * <p><b>Range of valid values:</b><br> |
| 2493 | * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2494 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2495 | * <p><b>Full capability</b> - |
| 2496 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 2497 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Zhijun He | fb46c64 | 2014-01-14 17:57:23 -0800 | [diff] [blame] | 2498 | * |
Zhijun He | 399f05d | 2014-01-15 11:31:30 -0800 | [diff] [blame] | 2499 | * @see CaptureRequest#CONTROL_AE_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2500 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 2501 | * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 2502 | * @see CaptureResult#LENS_STATE |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 2503 | * @see CaptureRequest#SENSOR_EXPOSURE_TIME |
Eino-Ville Talvala | d8fd679 | 2014-02-10 12:41:04 -0800 | [diff] [blame] | 2504 | * @see CaptureRequest#SENSOR_FRAME_DURATION |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 2505 | * @see CaptureRequest#SENSOR_SENSITIVITY |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2506 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2507 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2508 | public static final Key<Float> LENS_APERTURE = |
| 2509 | new Key<Float>("android.lens.aperture", float.class); |
| 2510 | |
| 2511 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2512 | * <p>The desired setting for the lens neutral density filter(s).</p> |
| 2513 | * <p>This control will not be supported on most camera devices.</p> |
Ruben Brunk | 855bae4 | 2014-01-17 10:30:32 -0800 | [diff] [blame] | 2514 | * <p>Lens filters are typically used to lower the amount of light the |
| 2515 | * sensor is exposed to (measured in steps of EV). As used here, an EV |
| 2516 | * step is the standard logarithmic representation, which are |
| 2517 | * non-negative, and inversely proportional to the amount of light |
| 2518 | * hitting the sensor. For example, setting this to 0 would result |
| 2519 | * in no reduction of the incoming light, and setting this to 2 would |
| 2520 | * mean that the filter is set to reduce incoming light by two stops |
| 2521 | * (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] | 2522 | * <p>It may take several frames before the lens filter density changes |
| 2523 | * to the requested value. While the filter density is still changing, |
| 2524 | * {@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] | 2525 | * <p><b>Units</b>: Exposure Value (EV)</p> |
| 2526 | * <p><b>Range of valid values:</b><br> |
| 2527 | * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2528 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2529 | * <p><b>Full capability</b> - |
| 2530 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 2531 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Ruben Brunk | 855bae4 | 2014-01-17 10:30:32 -0800 | [diff] [blame] | 2532 | * |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2533 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Ruben Brunk | 855bae4 | 2014-01-17 10:30:32 -0800 | [diff] [blame] | 2534 | * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 2535 | * @see CaptureResult#LENS_STATE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2536 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2537 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2538 | public static final Key<Float> LENS_FILTER_DENSITY = |
| 2539 | new Key<Float>("android.lens.filterDensity", float.class); |
| 2540 | |
| 2541 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2542 | * <p>The desired lens focal length; used for optical zoom.</p> |
Ruben Brunk | a20f4c2 | 2014-01-17 15:21:13 -0800 | [diff] [blame] | 2543 | * <p>This setting controls the physical focal length of the camera |
| 2544 | * device's lens. Changing the focal length changes the field of |
| 2545 | * view of the camera device, and is usually used for optical zoom.</p> |
| 2546 | * <p>Like {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, this |
| 2547 | * setting won't be applied instantaneously, and it may take several |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 2548 | * frames before the lens can change to the requested focal length. |
Ruben Brunk | a20f4c2 | 2014-01-17 15:21:13 -0800 | [diff] [blame] | 2549 | * While the focal length is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will |
| 2550 | * be set to MOVING.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2551 | * <p>Optical zoom will not be supported on most devices.</p> |
| 2552 | * <p><b>Units</b>: Millimeters</p> |
| 2553 | * <p><b>Range of valid values:</b><br> |
| 2554 | * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2555 | * <p>This key is available on all devices.</p> |
Ruben Brunk | a20f4c2 | 2014-01-17 15:21:13 -0800 | [diff] [blame] | 2556 | * |
| 2557 | * @see CaptureRequest#LENS_APERTURE |
| 2558 | * @see CaptureRequest#LENS_FOCUS_DISTANCE |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2559 | * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS |
Ruben Brunk | a20f4c2 | 2014-01-17 15:21:13 -0800 | [diff] [blame] | 2560 | * @see CaptureResult#LENS_STATE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2561 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2562 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2563 | public static final Key<Float> LENS_FOCAL_LENGTH = |
| 2564 | new Key<Float>("android.lens.focalLength", float.class); |
| 2565 | |
| 2566 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2567 | * <p>Desired distance to plane of sharpest focus, |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 2568 | * measured from frontmost surface of the lens.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2569 | * <p>Should be zero for fixed-focus cameras</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2570 | * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p> |
| 2571 | * <p><b>Range of valid values:</b><br> |
| 2572 | * >= 0</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2573 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2574 | * <p><b>Full capability</b> - |
| 2575 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 2576 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
| 2577 | * |
| 2578 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2579 | * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2580 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2581 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2582 | public static final Key<Float> LENS_FOCUS_DISTANCE = |
| 2583 | new Key<Float>("android.lens.focusDistance", float.class); |
| 2584 | |
| 2585 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2586 | * <p>The range of scene distances that are in |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 2587 | * sharp focus (depth of field).</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2588 | * <p>If variable focus not supported, can still report |
| 2589 | * fixed depth of field range</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2590 | * <p><b>Units</b>: A pair of focus distances in diopters: (near, |
| 2591 | * far); see {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details.</p> |
| 2592 | * <p><b>Range of valid values:</b><br> |
| 2593 | * >=0</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2594 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2595 | * <p><b>Limited capability</b> - |
| 2596 | * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the |
| 2597 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
| 2598 | * |
| 2599 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2600 | * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2601 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2602 | @PublicKey |
Igor Murashkin | 5743868 | 2014-05-30 10:49:00 -0700 | [diff] [blame] | 2603 | public static final Key<android.util.Pair<Float,Float>> LENS_FOCUS_RANGE = |
| 2604 | 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] | 2605 | |
| 2606 | /** |
Ruben Brunk | 00849b3 | 2014-01-17 18:30:23 -0800 | [diff] [blame] | 2607 | * <p>Sets whether the camera device uses optical image stabilization (OIS) |
| 2608 | * when capturing images.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 2609 | * <p>OIS is used to compensate for motion blur due to small |
| 2610 | * movements of the camera during capture. Unlike digital image |
| 2611 | * stabilization ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), OIS |
| 2612 | * makes use of mechanical elements to stabilize the camera |
| 2613 | * sensor, and thus allows for longer exposure times before |
| 2614 | * camera shake becomes apparent.</p> |
Zhijun He | 45fa43a1 | 2014-06-13 18:29:37 -0700 | [diff] [blame] | 2615 | * <p>Switching between different optical stabilization modes may take several |
| 2616 | * frames to initialize, the camera device will report the current mode in |
| 2617 | * capture result metadata. For example, When "ON" mode is requested, the |
| 2618 | * optical stabilization modes in the first several capture results may still |
| 2619 | * 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] | 2620 | * <p>If a camera device supports both OIS and digital image stabilization |
| 2621 | * ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), turning both modes on may produce undesirable |
| 2622 | * 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] | 2623 | * <p>Not all devices will support OIS; see |
| 2624 | * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization} for |
| 2625 | * available controls.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2626 | * <p><b>Possible values:</b> |
| 2627 | * <ul> |
| 2628 | * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_OFF OFF}</li> |
| 2629 | * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_ON ON}</li> |
| 2630 | * </ul></p> |
| 2631 | * <p><b>Available values for this device:</b><br> |
| 2632 | * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2633 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2634 | * <p><b>Limited capability</b> - |
| 2635 | * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the |
| 2636 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 2637 | * |
| 2638 | * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2639 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 2640 | * @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2641 | * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF |
| 2642 | * @see #LENS_OPTICAL_STABILIZATION_MODE_ON |
| 2643 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2644 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2645 | public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE = |
| 2646 | new Key<Integer>("android.lens.opticalStabilizationMode", int.class); |
| 2647 | |
| 2648 | /** |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 2649 | * <p>Current lens status.</p> |
| 2650 | * <p>For lens parameters {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}, {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance}, |
| 2651 | * {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, when changes are requested, |
| 2652 | * they may take several frames to reach the requested values. This state indicates |
| 2653 | * the current status of the lens parameters.</p> |
| 2654 | * <p>When the state is STATIONARY, the lens parameters are not changing. This could be |
| 2655 | * either because the parameters are all fixed, or because the lens has had enough |
| 2656 | * time to reach the most recently-requested values. |
| 2657 | * If all these lens parameters are not changable for a camera device, as listed below:</p> |
| 2658 | * <ul> |
| 2659 | * <li>Fixed focus (<code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} == 0</code>), which means |
| 2660 | * {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} parameter will always be 0.</li> |
| 2661 | * <li>Fixed focal length ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths} contains single value), |
| 2662 | * which means the optical zoom is not supported.</li> |
| 2663 | * <li>No ND filter ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities} contains only 0).</li> |
| 2664 | * <li>Fixed aperture ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures} contains single value).</li> |
| 2665 | * </ul> |
| 2666 | * <p>Then this state will always be STATIONARY.</p> |
| 2667 | * <p>When the state is MOVING, it indicates that at least one of the lens parameters |
| 2668 | * is changing.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2669 | * <p><b>Possible values:</b> |
| 2670 | * <ul> |
| 2671 | * <li>{@link #LENS_STATE_STATIONARY STATIONARY}</li> |
| 2672 | * <li>{@link #LENS_STATE_MOVING MOVING}</li> |
| 2673 | * </ul></p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2674 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2675 | * <p><b>Limited capability</b> - |
| 2676 | * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the |
| 2677 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 2678 | * |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2679 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 2680 | * @see CaptureRequest#LENS_APERTURE |
| 2681 | * @see CaptureRequest#LENS_FILTER_DENSITY |
| 2682 | * @see CaptureRequest#LENS_FOCAL_LENGTH |
| 2683 | * @see CaptureRequest#LENS_FOCUS_DISTANCE |
| 2684 | * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES |
| 2685 | * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES |
| 2686 | * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS |
| 2687 | * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2688 | * @see #LENS_STATE_STATIONARY |
Igor Murashkin | 9ea4ae6 | 2013-09-11 21:40:11 -0700 | [diff] [blame] | 2689 | * @see #LENS_STATE_MOVING |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2690 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2691 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2692 | public static final Key<Integer> LENS_STATE = |
| 2693 | new Key<Integer>("android.lens.state", int.class); |
| 2694 | |
| 2695 | /** |
Eino-Ville Talvala | 046a978 | 2015-04-08 20:05:56 +0000 | [diff] [blame] | 2696 | * <p>The orientation of the camera relative to the sensor |
| 2697 | * coordinate system.</p> |
Eino-Ville Talvala | abf0b8b | 2015-08-19 16:21:15 -0700 | [diff] [blame] | 2698 | * <p>The four coefficients that describe the quaternion |
Eino-Ville Talvala | 046a978 | 2015-04-08 20:05:56 +0000 | [diff] [blame] | 2699 | * rotation from the Android sensor coordinate system to a |
| 2700 | * camera-aligned coordinate system where the X-axis is |
| 2701 | * aligned with the long side of the image sensor, the Y-axis |
| 2702 | * is aligned with the short side of the image sensor, and |
| 2703 | * 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] | 2704 | * <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] | 2705 | * to the axis of rotation <code>(a_x, a_y, a_z)</code> and rotation |
| 2706 | * amount <code>theta</code>, the following formulas can be used:</p> |
| 2707 | * <pre><code> theta = 2 * acos(w) |
| 2708 | * a_x = x / sin(theta/2) |
| 2709 | * a_y = y / sin(theta/2) |
| 2710 | * a_z = z / sin(theta/2) |
| 2711 | * </code></pre> |
| 2712 | * <p>To create a 3x3 rotation matrix that applies the rotation |
Eino-Ville Talvala | abf0b8b | 2015-08-19 16:21:15 -0700 | [diff] [blame] | 2713 | * defined by this quaternion, the following matrix can be |
Eino-Ville Talvala | 046a978 | 2015-04-08 20:05:56 +0000 | [diff] [blame] | 2714 | * used:</p> |
| 2715 | * <pre><code>R = [ 1 - 2y^2 - 2z^2, 2xy - 2zw, 2xz + 2yw, |
| 2716 | * 2xy + 2zw, 1 - 2x^2 - 2z^2, 2yz - 2xw, |
| 2717 | * 2xz - 2yw, 2yz + 2xw, 1 - 2x^2 - 2y^2 ] |
| 2718 | * </code></pre> |
| 2719 | * <p>This matrix can then be used to apply the rotation to a |
| 2720 | * column vector point with</p> |
| 2721 | * <p><code>p' = Rp</code></p> |
| 2722 | * <p>where <code>p</code> is in the device sensor coordinate system, and |
| 2723 | * <code>p'</code> is in the camera-oriented coordinate system.</p> |
| 2724 | * <p><b>Units</b>: |
Eino-Ville Talvala | abf0b8b | 2015-08-19 16:21:15 -0700 | [diff] [blame] | 2725 | * Quaternion coefficients</p> |
Eino-Ville Talvala | 046a978 | 2015-04-08 20:05:56 +0000 | [diff] [blame] | 2726 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2727 | */ |
| 2728 | @PublicKey |
| 2729 | public static final Key<float[]> LENS_POSE_ROTATION = |
| 2730 | new Key<float[]>("android.lens.poseRotation", float[].class); |
| 2731 | |
| 2732 | /** |
| 2733 | * <p>Position of the camera optical center.</p> |
Eino-Ville Talvala | d3dbfb3 | 2015-05-29 17:17:04 -0700 | [diff] [blame] | 2734 | * <p>The position of the camera device's lens optical center, |
| 2735 | * as a three-dimensional vector <code>(x,y,z)</code>, relative to the |
| 2736 | * optical center of the largest camera device facing in the |
| 2737 | * same direction as this camera, in the {@link android.hardware.SensorEvent Android sensor coordinate |
| 2738 | * axes}. Note that only the axis definitions are shared with |
| 2739 | * the sensor coordinate system, but not the origin.</p> |
| 2740 | * <p>If this device is the largest or only camera device with a |
| 2741 | * given facing, then this position will be <code>(0, 0, 0)</code>; a |
| 2742 | * camera device with a lens optical center located 3 cm from |
| 2743 | * the main sensor along the +X axis (to the right from the |
| 2744 | * user's perspective) will report <code>(0.03, 0, 0)</code>.</p> |
| 2745 | * <p>To transform a pixel coordinates between two cameras |
| 2746 | * facing the same direction, first the source camera |
Eino-Ville Talvala | abf0b8b | 2015-08-19 16:21:15 -0700 | [diff] [blame] | 2747 | * {@link CameraCharacteristics#LENS_RADIAL_DISTORTION android.lens.radialDistortion} must be corrected for. Then |
| 2748 | * the source camera {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} needs |
Eino-Ville Talvala | d3dbfb3 | 2015-05-29 17:17:04 -0700 | [diff] [blame] | 2749 | * to be applied, followed by the {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} |
| 2750 | * of the source camera, the translation of the source camera |
| 2751 | * relative to the destination camera, the |
| 2752 | * {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} of the destination camera, and |
Eino-Ville Talvala | abf0b8b | 2015-08-19 16:21:15 -0700 | [diff] [blame] | 2753 | * finally the inverse of {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} |
Eino-Ville Talvala | d3dbfb3 | 2015-05-29 17:17:04 -0700 | [diff] [blame] | 2754 | * of the destination camera. This obtains a |
| 2755 | * radial-distortion-free coordinate in the destination |
| 2756 | * camera pixel coordinates.</p> |
| 2757 | * <p>To compare this against a real image from the destination |
| 2758 | * camera, the destination camera image then needs to be |
| 2759 | * corrected for radial distortion before comparison or |
| 2760 | * sampling.</p> |
Eino-Ville Talvala | 046a978 | 2015-04-08 20:05:56 +0000 | [diff] [blame] | 2761 | * <p><b>Units</b>: Meters</p> |
| 2762 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2763 | * |
Eino-Ville Talvala | abf0b8b | 2015-08-19 16:21:15 -0700 | [diff] [blame] | 2764 | * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION |
Eino-Ville Talvala | 046a978 | 2015-04-08 20:05:56 +0000 | [diff] [blame] | 2765 | * @see CameraCharacteristics#LENS_POSE_ROTATION |
Eino-Ville Talvala | abf0b8b | 2015-08-19 16:21:15 -0700 | [diff] [blame] | 2766 | * @see CameraCharacteristics#LENS_RADIAL_DISTORTION |
Eino-Ville Talvala | 046a978 | 2015-04-08 20:05:56 +0000 | [diff] [blame] | 2767 | */ |
| 2768 | @PublicKey |
| 2769 | public static final Key<float[]> LENS_POSE_TRANSLATION = |
| 2770 | new Key<float[]>("android.lens.poseTranslation", float[].class); |
| 2771 | |
| 2772 | /** |
| 2773 | * <p>The parameters for this camera device's intrinsic |
| 2774 | * calibration.</p> |
| 2775 | * <p>The five calibration parameters that describe the |
| 2776 | * transform from camera-centric 3D coordinates to sensor |
| 2777 | * pixel coordinates:</p> |
| 2778 | * <pre><code>[f_x, f_y, c_x, c_y, s] |
| 2779 | * </code></pre> |
| 2780 | * <p>Where <code>f_x</code> and <code>f_y</code> are the horizontal and vertical |
| 2781 | * focal lengths, <code>[c_x, c_y]</code> is the position of the optical |
| 2782 | * axis, and <code>s</code> is a skew parameter for the sensor plane not |
| 2783 | * being aligned with the lens plane.</p> |
| 2784 | * <p>These are typically used within a transformation matrix K:</p> |
| 2785 | * <pre><code>K = [ f_x, s, c_x, |
| 2786 | * 0, f_y, c_y, |
| 2787 | * 0 0, 1 ] |
| 2788 | * </code></pre> |
| 2789 | * <p>which can then be combined with the camera pose rotation |
| 2790 | * <code>R</code> and translation <code>t</code> ({@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} and |
| 2791 | * {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation}, respective) to calculate the |
| 2792 | * complete transform from world coordinates to pixel |
| 2793 | * coordinates:</p> |
| 2794 | * <pre><code>P = [ K 0 * [ R t |
| 2795 | * 0 1 ] 0 1 ] |
| 2796 | * </code></pre> |
| 2797 | * <p>and with <code>p_w</code> being a point in the world coordinate system |
| 2798 | * and <code>p_s</code> being a point in the camera active pixel array |
| 2799 | * coordinate system, and with the mapping including the |
| 2800 | * homogeneous division by z:</p> |
| 2801 | * <pre><code> p_h = (x_h, y_h, z_h) = P p_w |
| 2802 | * p_s = p_h / z_h |
| 2803 | * </code></pre> |
| 2804 | * <p>so <code>[x_s, y_s]</code> is the pixel coordinates of the world |
| 2805 | * point, <code>z_s = 1</code>, and <code>w_s</code> is a measurement of disparity |
| 2806 | * (depth) in pixel coordinates.</p> |
Eino-Ville Talvala | b8bd8ab | 2015-06-16 11:44:10 -0700 | [diff] [blame] | 2807 | * <p>Note that the coordinate system for this transform is the |
| 2808 | * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} system, |
| 2809 | * where <code>(0,0)</code> is the top-left of the |
| 2810 | * preCorrectionActiveArraySize rectangle. Once the pose and |
| 2811 | * intrinsic calibration transforms have been applied to a |
Eino-Ville Talvala | abf0b8b | 2015-08-19 16:21:15 -0700 | [diff] [blame] | 2812 | * world point, then the {@link CameraCharacteristics#LENS_RADIAL_DISTORTION android.lens.radialDistortion} |
Eino-Ville Talvala | b8bd8ab | 2015-06-16 11:44:10 -0700 | [diff] [blame] | 2813 | * transform needs to be applied, and the result adjusted to |
| 2814 | * be in the {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} coordinate |
| 2815 | * system (where <code>(0, 0)</code> is the top-left of the |
| 2816 | * activeArraySize rectangle), to determine the final pixel |
| 2817 | * coordinate of the world point for processed (non-RAW) |
| 2818 | * output buffers.</p> |
Eino-Ville Talvala | 046a978 | 2015-04-08 20:05:56 +0000 | [diff] [blame] | 2819 | * <p><b>Units</b>: |
Eino-Ville Talvala | b8bd8ab | 2015-06-16 11:44:10 -0700 | [diff] [blame] | 2820 | * Pixels in the |
| 2821 | * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} |
| 2822 | * coordinate system.</p> |
Eino-Ville Talvala | 046a978 | 2015-04-08 20:05:56 +0000 | [diff] [blame] | 2823 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2824 | * |
| 2825 | * @see CameraCharacteristics#LENS_POSE_ROTATION |
| 2826 | * @see CameraCharacteristics#LENS_POSE_TRANSLATION |
Eino-Ville Talvala | abf0b8b | 2015-08-19 16:21:15 -0700 | [diff] [blame] | 2827 | * @see CameraCharacteristics#LENS_RADIAL_DISTORTION |
Eino-Ville Talvala | 0b7b03b | 2015-04-13 17:29:52 -0700 | [diff] [blame] | 2828 | * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE |
Eino-Ville Talvala | b8bd8ab | 2015-06-16 11:44:10 -0700 | [diff] [blame] | 2829 | * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE |
Eino-Ville Talvala | 046a978 | 2015-04-08 20:05:56 +0000 | [diff] [blame] | 2830 | */ |
| 2831 | @PublicKey |
| 2832 | public static final Key<float[]> LENS_INTRINSIC_CALIBRATION = |
| 2833 | new Key<float[]>("android.lens.intrinsicCalibration", float[].class); |
| 2834 | |
| 2835 | /** |
| 2836 | * <p>The correction coefficients to correct for this camera device's |
Eino-Ville Talvala | 66c73ba | 2015-05-29 16:11:56 -0700 | [diff] [blame] | 2837 | * radial and tangential lens distortion.</p> |
Ruben Brunk | 02cd8cb | 2015-06-15 15:33:09 -0700 | [diff] [blame] | 2838 | * <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] | 2839 | * kappa_3]</code> and two tangential distortion coefficients |
| 2840 | * <code>[kappa_4, kappa_5]</code> that can be used to correct the |
| 2841 | * lens's geometric distortion with the mapping equations:</p> |
Ruben Brunk | 02cd8cb | 2015-06-15 15:33:09 -0700 | [diff] [blame] | 2842 | * <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] | 2843 | * 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] | 2844 | * 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] | 2845 | * 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] | 2846 | * </code></pre> |
Eino-Ville Talvala | 66c73ba | 2015-05-29 16:11:56 -0700 | [diff] [blame] | 2847 | * <p>Here, <code>[x_c, y_c]</code> are the coordinates to sample in the |
| 2848 | * input image that correspond to the pixel values in the |
| 2849 | * corrected image at the coordinate <code>[x_i, y_i]</code>:</p> |
| 2850 | * <pre><code> correctedImage(x_i, y_i) = sample_at(x_c, y_c, inputImage) |
| 2851 | * </code></pre> |
| 2852 | * <p>The pixel coordinates are defined in a normalized |
| 2853 | * coordinate system related to the |
Eino-Ville Talvala | abf0b8b | 2015-08-19 16:21:15 -0700 | [diff] [blame] | 2854 | * {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} calibration fields. |
Eino-Ville Talvala | 66c73ba | 2015-05-29 16:11:56 -0700 | [diff] [blame] | 2855 | * Both <code>[x_i, y_i]</code> and <code>[x_c, y_c]</code> have <code>(0,0)</code> at the |
| 2856 | * lens optical center <code>[c_x, c_y]</code>. The maximum magnitudes |
| 2857 | * of both x and y coordinates are normalized to be 1 at the |
| 2858 | * edge further from the optical center, so the range |
| 2859 | * for both dimensions is <code>-1 <= x <= 1</code>.</p> |
| 2860 | * <p>Finally, <code>r</code> represents the radial distance from the |
| 2861 | * optical center, <code>r^2 = x_i^2 + y_i^2</code>, and its magnitude |
| 2862 | * is therefore no larger than <code>|r| <= sqrt(2)</code>.</p> |
| 2863 | * <p>The distortion model used is the Brown-Conrady model.</p> |
Eino-Ville Talvala | 046a978 | 2015-04-08 20:05:56 +0000 | [diff] [blame] | 2864 | * <p><b>Units</b>: |
Eino-Ville Talvala | 66c73ba | 2015-05-29 16:11:56 -0700 | [diff] [blame] | 2865 | * Unitless coefficients.</p> |
Eino-Ville Talvala | 046a978 | 2015-04-08 20:05:56 +0000 | [diff] [blame] | 2866 | * <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] | 2867 | * |
| 2868 | * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION |
Eino-Ville Talvala | 046a978 | 2015-04-08 20:05:56 +0000 | [diff] [blame] | 2869 | */ |
| 2870 | @PublicKey |
| 2871 | public static final Key<float[]> LENS_RADIAL_DISTORTION = |
| 2872 | new Key<float[]>("android.lens.radialDistortion", float[].class); |
| 2873 | |
| 2874 | /** |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 2875 | * <p>Mode of operation for the noise reduction algorithm.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2876 | * <p>The noise reduction algorithm attempts to improve image quality by removing |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 2877 | * excessive noise added by the capture process, especially in dark conditions.</p> |
| 2878 | * <p>OFF means no noise reduction will be applied by the camera device, for both raw and |
| 2879 | * YUV domain.</p> |
| 2880 | * <p>MINIMAL means that only sensor raw domain basic noise reduction is enabled ,to remove |
| 2881 | * demosaicing or other processing artifacts. For YUV_REPROCESSING, MINIMAL is same as OFF. |
| 2882 | * This mode is optional, may not be support by all devices. The application should check |
| 2883 | * {@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] | 2884 | * <p>FAST/HIGH_QUALITY both mean camera device determined noise filtering |
| 2885 | * will be applied. HIGH_QUALITY mode indicates that the camera device |
| 2886 | * will use the highest-quality noise filtering algorithms, |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 2887 | * 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] | 2888 | * slow down capture rate when applying noise filtering. FAST may be the same as MINIMAL if |
| 2889 | * MINIMAL is listed, or the same as OFF if any noise filtering will slow down capture rate. |
| 2890 | * 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] | 2891 | * <p>ZERO_SHUTTER_LAG is meant to be used by applications that maintain a continuous circular |
| 2892 | * buffer of high-resolution images during preview and reprocess image(s) from that buffer |
| 2893 | * into a final capture when triggered by the user. In this mode, the camera device applies |
| 2894 | * noise reduction to low-resolution streams (below maximum recording resolution) to maximize |
| 2895 | * preview quality, but does not apply noise reduction to high-resolution streams, since |
| 2896 | * those will be reprocessed later if necessary.</p> |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 2897 | * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera device |
| 2898 | * will apply FAST/HIGH_QUALITY YUV domain noise reduction, respectively. The camera device |
| 2899 | * may adjust the noise reduction parameters for best image quality based on the |
| 2900 | * {@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] | 2901 | * <p><b>Possible values:</b> |
| 2902 | * <ul> |
| 2903 | * <li>{@link #NOISE_REDUCTION_MODE_OFF OFF}</li> |
| 2904 | * <li>{@link #NOISE_REDUCTION_MODE_FAST FAST}</li> |
| 2905 | * <li>{@link #NOISE_REDUCTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li> |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 2906 | * <li>{@link #NOISE_REDUCTION_MODE_MINIMAL MINIMAL}</li> |
Eino-Ville Talvala | 0dd1750 | 2015-07-07 10:43:07 -0700 | [diff] [blame] | 2907 | * <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] | 2908 | * </ul></p> |
| 2909 | * <p><b>Available values for this device:</b><br> |
| 2910 | * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2911 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2912 | * <p><b>Full capability</b> - |
| 2913 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 2914 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Ruben Brunk | 6dc379c | 2014-03-04 15:04:00 -0800 | [diff] [blame] | 2915 | * |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2916 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Ruben Brunk | 6dc379c | 2014-03-04 15:04:00 -0800 | [diff] [blame] | 2917 | * @see CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 2918 | * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2919 | * @see #NOISE_REDUCTION_MODE_OFF |
| 2920 | * @see #NOISE_REDUCTION_MODE_FAST |
| 2921 | * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 2922 | * @see #NOISE_REDUCTION_MODE_MINIMAL |
Eino-Ville Talvala | 0dd1750 | 2015-07-07 10:43:07 -0700 | [diff] [blame] | 2923 | * @see #NOISE_REDUCTION_MODE_ZERO_SHUTTER_LAG |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2924 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2925 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2926 | public static final Key<Integer> NOISE_REDUCTION_MODE = |
| 2927 | new Key<Integer>("android.noiseReduction.mode", int.class); |
| 2928 | |
| 2929 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2930 | * <p>Whether a result given to the framework is the |
Eino-Ville Talvala | 7a31310 | 2013-11-07 14:45:06 -0800 | [diff] [blame] | 2931 | * final one for the capture, or only a partial that contains a |
| 2932 | * subset of the full set of dynamic metadata |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2933 | * values.</p> |
| 2934 | * <p>The entries in the result metadata buffers for a |
Eino-Ville Talvala | 7a31310 | 2013-11-07 14:45:06 -0800 | [diff] [blame] | 2935 | * single capture may not overlap, except for this entry. The |
| 2936 | * FINAL buffers must retain FIFO ordering relative to the |
| 2937 | * requests that generate them, so the FINAL buffer for frame 3 must |
| 2938 | * always be sent to the framework after the FINAL buffer for frame 2, and |
| 2939 | * before the FINAL buffer for frame 4. PARTIAL buffers may be returned |
| 2940 | * in any order relative to other frames, but all PARTIAL buffers for a given |
| 2941 | * 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] | 2942 | * 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] | 2943 | * <p><b>Range of valid values:</b><br> |
| 2944 | * Optional. Default value is FINAL.</p> |
Igor Murashkin | 3242f4f | 2014-01-15 12:27:41 -0800 | [diff] [blame] | 2945 | * <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] | 2946 | * @deprecated |
Eino-Ville Talvala | 7a31310 | 2013-11-07 14:45:06 -0800 | [diff] [blame] | 2947 | * @hide |
| 2948 | */ |
Igor Murashkin | 9c59517 | 2014-05-12 13:56:20 -0700 | [diff] [blame] | 2949 | @Deprecated |
Eino-Ville Talvala | 7a31310 | 2013-11-07 14:45:06 -0800 | [diff] [blame] | 2950 | public static final Key<Boolean> QUIRKS_PARTIAL_RESULT = |
| 2951 | new Key<Boolean>("android.quirks.partialResult", boolean.class); |
| 2952 | |
| 2953 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2954 | * <p>A frame counter set by the framework. This value monotonically |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 2955 | * 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] | 2956 | * frameCount value).</p> |
| 2957 | * <p>Reset on release()</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2958 | * <p><b>Units</b>: count of frames</p> |
| 2959 | * <p><b>Range of valid values:</b><br> |
| 2960 | * > 0</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2961 | * <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] | 2962 | * @deprecated |
| 2963 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2964 | */ |
Igor Murashkin | bdf366c | 2014-07-25 16:54:20 -0700 | [diff] [blame] | 2965 | @Deprecated |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2966 | public static final Key<Integer> REQUEST_FRAME_COUNT = |
| 2967 | new Key<Integer>("android.request.frameCount", int.class); |
| 2968 | |
| 2969 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2970 | * <p>An application-specified ID for the current |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2971 | * request. Must be maintained unchanged in output |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2972 | * frame</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2973 | * <p><b>Units</b>: arbitrary integer assigned by application</p> |
| 2974 | * <p><b>Range of valid values:</b><br> |
| 2975 | * Any int</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2976 | * <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] | 2977 | * @hide |
| 2978 | */ |
| 2979 | public static final Key<Integer> REQUEST_ID = |
| 2980 | new Key<Integer>("android.request.id", int.class); |
| 2981 | |
| 2982 | /** |
Igor Murashkin | c127f05 | 2014-01-17 18:06:02 -0800 | [diff] [blame] | 2983 | * <p>Specifies the number of pipeline stages the frame went |
| 2984 | * through from when it was exposed to when the final completed result |
| 2985 | * was available to the framework.</p> |
| 2986 | * <p>Depending on what settings are used in the request, and |
| 2987 | * what streams are configured, the data may undergo less processing, |
| 2988 | * and some pipeline stages skipped.</p> |
| 2989 | * <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] | 2990 | * <p><b>Range of valid values:</b><br> |
| 2991 | * <= {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2992 | * <p>This key is available on all devices.</p> |
Igor Murashkin | c127f05 | 2014-01-17 18:06:02 -0800 | [diff] [blame] | 2993 | * |
| 2994 | * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH |
| 2995 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2996 | @PublicKey |
Igor Murashkin | c127f05 | 2014-01-17 18:06:02 -0800 | [diff] [blame] | 2997 | public static final Key<Byte> REQUEST_PIPELINE_DEPTH = |
| 2998 | new Key<Byte>("android.request.pipelineDepth", byte.class); |
| 2999 | |
| 3000 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3001 | * <p>The desired region of the sensor to read out for this capture.</p> |
| 3002 | * <p>This control can be used to implement digital zoom.</p> |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 3003 | * <p>The crop region coordinate system is based off |
| 3004 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being the |
| 3005 | * top-left corner of the sensor active array.</p> |
| 3006 | * <p>Output streams use this rectangle to produce their output, |
| 3007 | * cropping to a smaller region if necessary to maintain the |
| 3008 | * stream's aspect ratio, then scaling the sensor input to |
| 3009 | * match the output's configured resolution.</p> |
| 3010 | * <p>The crop region is applied after the RAW to other color |
| 3011 | * space (e.g. YUV) conversion. Since raw streams |
| 3012 | * (e.g. RAW16) don't have the conversion stage, they are not |
| 3013 | * croppable. The crop region will be ignored by raw streams.</p> |
Zhijun He | 9e6d188 | 2014-05-22 16:47:35 -0700 | [diff] [blame] | 3014 | * <p>For non-raw streams, any additional per-stream cropping will |
| 3015 | * be done to maximize the final pixel area of the stream.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3016 | * <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] | 3017 | * ratio, then 4:3 streams will use the exact crop |
| 3018 | * region. 16:9 streams will further crop vertically |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3019 | * (letterbox).</p> |
| 3020 | * <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] | 3021 | * outputs will crop horizontally (pillarbox), and 16:9 |
| 3022 | * streams will match exactly. These additional crops will |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3023 | * be centered within the crop region.</p> |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 3024 | * <p>The width and height of the crop region cannot |
| 3025 | * be set to be smaller than |
| 3026 | * <code>floor( activeArraySize.width / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code> and |
| 3027 | * <code>floor( activeArraySize.height / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code>, respectively.</p> |
| 3028 | * <p>The camera device may adjust the crop region to account |
| 3029 | * for rounding and other hardware requirements; the final |
| 3030 | * crop region used will be included in the output capture |
| 3031 | * result.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3032 | * <p><b>Units</b>: Pixel coordinates relative to |
| 3033 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3034 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | d8fd679 | 2014-02-10 12:41:04 -0800 | [diff] [blame] | 3035 | * |
| 3036 | * @see CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 3037 | * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3038 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 3039 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3040 | public static final Key<android.graphics.Rect> SCALER_CROP_REGION = |
| 3041 | new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class); |
| 3042 | |
| 3043 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3044 | * <p>Duration each pixel is exposed to |
| 3045 | * light.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3046 | * <p>If the sensor can't expose this exact duration, it will shorten the |
| 3047 | * duration exposed to the nearest possible value (rather than expose longer). |
| 3048 | * The final exposure time used will be available in the output capture result.</p> |
| 3049 | * <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 |
| 3050 | * OFF; otherwise the auto-exposure algorithm will override this value.</p> |
| 3051 | * <p><b>Units</b>: Nanoseconds</p> |
| 3052 | * <p><b>Range of valid values:</b><br> |
| 3053 | * {@link CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE android.sensor.info.exposureTimeRange}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3054 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 3055 | * <p><b>Full capability</b> - |
| 3056 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 3057 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
| 3058 | * |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3059 | * @see CaptureRequest#CONTROL_AE_MODE |
| 3060 | * @see CaptureRequest#CONTROL_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3061 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3062 | * @see CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3063 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 3064 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3065 | public static final Key<Long> SENSOR_EXPOSURE_TIME = |
| 3066 | new Key<Long>("android.sensor.exposureTime", long.class); |
| 3067 | |
| 3068 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3069 | * <p>Duration from start of frame exposure to |
Igor Murashkin | 143aa0b | 2014-01-17 15:02:34 -0800 | [diff] [blame] | 3070 | * start of next frame exposure.</p> |
| 3071 | * <p>The maximum frame rate that can be supported by a camera subsystem is |
| 3072 | * a function of many factors:</p> |
| 3073 | * <ul> |
| 3074 | * <li>Requested resolutions of output image streams</li> |
| 3075 | * <li>Availability of binning / skipping modes on the imager</li> |
| 3076 | * <li>The bandwidth of the imager interface</li> |
| 3077 | * <li>The bandwidth of the various ISP processing blocks</li> |
| 3078 | * </ul> |
| 3079 | * <p>Since these factors can vary greatly between different ISPs and |
| 3080 | * sensors, the camera abstraction tries to represent the bandwidth |
| 3081 | * restrictions with as simple a model as possible.</p> |
| 3082 | * <p>The model presented has the following characteristics:</p> |
| 3083 | * <ul> |
| 3084 | * <li>The image sensor is always configured to output the smallest |
| 3085 | * resolution possible given the application's requested output stream |
| 3086 | * sizes. The smallest resolution is defined as being at least as large |
| 3087 | * as the largest requested output stream size; the camera pipeline must |
| 3088 | * never digitally upsample sensor data when the crop region covers the |
| 3089 | * whole sensor. In general, this means that if only small output stream |
| 3090 | * resolutions are configured, the sensor can provide a higher frame |
| 3091 | * rate.</li> |
| 3092 | * <li>Since any request may use any or all the currently configured |
| 3093 | * output streams, the sensor and ISP must be configured to support |
| 3094 | * scaling a single capture to all the streams at the same time. This |
| 3095 | * means the camera pipeline must be ready to produce the largest |
| 3096 | * requested output size without any delay. Therefore, the overall |
| 3097 | * frame rate of a given configured stream set is governed only by the |
| 3098 | * largest requested stream resolution.</li> |
| 3099 | * <li>Using more than one output stream in a request does not affect the |
| 3100 | * frame duration.</li> |
Igor Murashkin | a23ffb5 | 2014-02-07 18:52:34 -0800 | [diff] [blame] | 3101 | * <li>Certain format-streams may need to do additional background processing |
| 3102 | * before data is consumed/produced by that stream. These processors |
| 3103 | * can run concurrently to the rest of the camera pipeline, but |
| 3104 | * cannot process more than 1 capture at a time.</li> |
Igor Murashkin | 143aa0b | 2014-01-17 15:02:34 -0800 | [diff] [blame] | 3105 | * </ul> |
| 3106 | * <p>The necessary information for the application, given the model above, |
Eino-Ville Talvala | b6eb52f | 2015-04-16 16:39:45 -0700 | [diff] [blame] | 3107 | * is provided via the {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} field using |
| 3108 | * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration }. |
Igor Murashkin | 143aa0b | 2014-01-17 15:02:34 -0800 | [diff] [blame] | 3109 | * These are used to determine the maximum frame rate / minimum frame |
| 3110 | * duration that is possible for a given stream configuration.</p> |
| 3111 | * <p>Specifically, the application can use the following rules to |
Igor Murashkin | a23ffb5 | 2014-02-07 18:52:34 -0800 | [diff] [blame] | 3112 | * determine the minimum frame duration it can request from the camera |
Igor Murashkin | 143aa0b | 2014-01-17 15:02:34 -0800 | [diff] [blame] | 3113 | * device:</p> |
| 3114 | * <ol> |
Igor Murashkin | a23ffb5 | 2014-02-07 18:52:34 -0800 | [diff] [blame] | 3115 | * <li>Let the set of currently configured input/output streams |
| 3116 | * be called <code>S</code>.</li> |
Eino-Ville Talvala | b6eb52f | 2015-04-16 16:39:45 -0700 | [diff] [blame] | 3117 | * <li>Find the minimum frame durations for each stream in <code>S</code>, by looking |
| 3118 | * it up in {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} using {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration } |
| 3119 | * (with its respective size/format). Let this set of frame durations be |
| 3120 | * called <code>F</code>.</li> |
Igor Murashkin | a23ffb5 | 2014-02-07 18:52:34 -0800 | [diff] [blame] | 3121 | * <li>For any given request <code>R</code>, the minimum frame duration allowed |
| 3122 | * for <code>R</code> is the maximum out of all values in <code>F</code>. Let the streams |
| 3123 | * used in <code>R</code> be called <code>S_r</code>.</li> |
Igor Murashkin | 143aa0b | 2014-01-17 15:02:34 -0800 | [diff] [blame] | 3124 | * </ol> |
Eino-Ville Talvala | b6eb52f | 2015-04-16 16:39:45 -0700 | [diff] [blame] | 3125 | * <p>If none of the streams in <code>S_r</code> have a stall time (listed in {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration } |
| 3126 | * using its respective size/format), then the frame duration in <code>F</code> |
| 3127 | * determines the steady state frame rate that the application will get |
| 3128 | * if it uses <code>R</code> as a repeating request. Let this special kind of |
| 3129 | * request be called <code>Rsimple</code>.</p> |
Igor Murashkin | a23ffb5 | 2014-02-07 18:52:34 -0800 | [diff] [blame] | 3130 | * <p>A repeating request <code>Rsimple</code> can be <em>occasionally</em> interleaved |
| 3131 | * by a single capture of a new request <code>Rstall</code> (which has at least |
| 3132 | * one in-use stream with a non-0 stall time) and if <code>Rstall</code> has the |
| 3133 | * same minimum frame duration this will not cause a frame rate loss |
| 3134 | * if all buffers from the previous <code>Rstall</code> have already been |
| 3135 | * delivered.</p> |
| 3136 | * <p>For more details about stalling, see |
Eino-Ville Talvala | b6eb52f | 2015-04-16 16:39:45 -0700 | [diff] [blame] | 3137 | * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration }.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3138 | * <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 |
| 3139 | * OFF; otherwise the auto-exposure algorithm will override this value.</p> |
| 3140 | * <p><b>Units</b>: Nanoseconds</p> |
| 3141 | * <p><b>Range of valid values:</b><br> |
| 3142 | * See {@link CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION android.sensor.info.maxFrameDuration}, |
| 3143 | * {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}. The duration |
| 3144 | * is capped to <code>max(duration, exposureTime + overhead)</code>.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3145 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 3146 | * <p><b>Full capability</b> - |
| 3147 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 3148 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Igor Murashkin | 143aa0b | 2014-01-17 15:02:34 -0800 | [diff] [blame] | 3149 | * |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3150 | * @see CaptureRequest#CONTROL_AE_MODE |
| 3151 | * @see CaptureRequest#CONTROL_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3152 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Igor Murashkin | 9c59517 | 2014-05-12 13:56:20 -0700 | [diff] [blame] | 3153 | * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3154 | * @see CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3155 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 3156 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3157 | public static final Key<Long> SENSOR_FRAME_DURATION = |
| 3158 | new Key<Long>("android.sensor.frameDuration", long.class); |
| 3159 | |
| 3160 | /** |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 3161 | * <p>The amount of gain applied to sensor data |
| 3162 | * before processing.</p> |
| 3163 | * <p>The sensitivity is the standard ISO sensitivity value, |
| 3164 | * as defined in ISO 12232:2006.</p> |
| 3165 | * <p>The sensitivity must be within {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}, and |
| 3166 | * if if it less than {@link CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY android.sensor.maxAnalogSensitivity}, the camera device |
| 3167 | * is guaranteed to use only analog amplification for applying the gain.</p> |
| 3168 | * <p>If the camera device cannot apply the exact sensitivity |
| 3169 | * requested, it will reduce the gain to the nearest supported |
| 3170 | * value. The final sensitivity used will be available in the |
| 3171 | * output capture result.</p> |
Yin-Chia Yeh | 1ee1a0a | 2016-01-18 19:13:47 -0800 | [diff] [blame] | 3172 | * <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 |
| 3173 | * OFF; otherwise the auto-exposure algorithm will override this value.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3174 | * <p><b>Units</b>: ISO arithmetic units</p> |
| 3175 | * <p><b>Range of valid values:</b><br> |
| 3176 | * {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3177 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 3178 | * <p><b>Full capability</b> - |
| 3179 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 3180 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 3181 | * |
Yin-Chia Yeh | 1ee1a0a | 2016-01-18 19:13:47 -0800 | [diff] [blame] | 3182 | * @see CaptureRequest#CONTROL_AE_MODE |
| 3183 | * @see CaptureRequest#CONTROL_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3184 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 3185 | * @see CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE |
| 3186 | * @see CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3187 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 3188 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3189 | public static final Key<Integer> SENSOR_SENSITIVITY = |
| 3190 | new Key<Integer>("android.sensor.sensitivity", int.class); |
| 3191 | |
| 3192 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3193 | * <p>Time at start of exposure of first |
Zhijun He | 0bda31a | 2014-06-13 14:38:39 -0700 | [diff] [blame] | 3194 | * row of the image sensor active array, in nanoseconds.</p> |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 3195 | * <p>The timestamps are also included in all image |
| 3196 | * buffers produced for the same capture, and will be identical |
Zhijun He | 45fa43a1 | 2014-06-13 18:29:37 -0700 | [diff] [blame] | 3197 | * on all the outputs.</p> |
Eino-Ville Talvala | abd9d3c | 2014-07-28 13:01:52 -0700 | [diff] [blame] | 3198 | * <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] | 3199 | * the timestamps measure time since an unspecified starting point, |
| 3200 | * and are monotonically increasing. They can be compared with the |
| 3201 | * timestamps for other captures from the same camera device, but are |
| 3202 | * not guaranteed to be comparable to any other time source.</p> |
Eino-Ville Talvala | b6eb52f | 2015-04-16 16:39:45 -0700 | [diff] [blame] | 3203 | * <p>When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> REALTIME, the |
| 3204 | * timestamps measure time in the same timebase as {@link android.os.SystemClock#elapsedRealtimeNanos }, and they can |
| 3205 | * be compared to other timestamps from other subsystems that |
| 3206 | * are using that base.</p> |
Chien-Yu Chen | 6216e4e | 2015-05-29 11:49:54 -0700 | [diff] [blame] | 3207 | * <p>For reprocessing, the timestamp will match the start of exposure of |
| 3208 | * the input image, i.e. {@link CaptureResult#SENSOR_TIMESTAMP the |
| 3209 | * timestamp} in the TotalCaptureResult that was used to create the |
| 3210 | * reprocess capture request.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3211 | * <p><b>Units</b>: Nanoseconds</p> |
| 3212 | * <p><b>Range of valid values:</b><br> |
| 3213 | * > 0</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3214 | * <p>This key is available on all devices.</p> |
Zhijun He | 45fa43a1 | 2014-06-13 18:29:37 -0700 | [diff] [blame] | 3215 | * |
Eino-Ville Talvala | abd9d3c | 2014-07-28 13:01:52 -0700 | [diff] [blame] | 3216 | * @see CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3217 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 3218 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3219 | public static final Key<Long> SENSOR_TIMESTAMP = |
| 3220 | new Key<Long>("android.sensor.timestamp", long.class); |
| 3221 | |
| 3222 | /** |
Ruben Brunk | 7c06236 | 2014-04-15 23:53:53 -0700 | [diff] [blame] | 3223 | * <p>The estimated camera neutral color in the native sensor colorspace at |
| 3224 | * the time of capture.</p> |
| 3225 | * <p>This value gives the neutral color point encoded as an RGB value in the |
| 3226 | * native sensor color space. The neutral color point indicates the |
| 3227 | * currently estimated white point of the scene illumination. It can be |
| 3228 | * used to interpolate between the provided color transforms when |
| 3229 | * processing raw sensor data.</p> |
| 3230 | * <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] | 3231 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 3232 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 3233 | @PublicKey |
Ruben Brunk | 20c76f6 | 2014-02-07 15:47:10 -0800 | [diff] [blame] | 3234 | public static final Key<Rational[]> SENSOR_NEUTRAL_COLOR_POINT = |
| 3235 | new Key<Rational[]>("android.sensor.neutralColorPoint", Rational[].class); |
| 3236 | |
| 3237 | /** |
Ruben Brunk | 1b1f1b6 | 2014-07-23 17:49:08 -0700 | [diff] [blame] | 3238 | * <p>Noise model coefficients for each CFA mosaic channel.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3239 | * <p>This key contains two noise model coefficients for each CFA channel |
Ruben Brunk | 1b1f1b6 | 2014-07-23 17:49:08 -0700 | [diff] [blame] | 3240 | * corresponding to the sensor amplification (S) and sensor readout |
| 3241 | * 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] | 3242 | * in the same order as channels listed for the CFA layout key |
Ruben Brunk | 1b1f1b6 | 2014-07-23 17:49:08 -0700 | [diff] [blame] | 3243 | * (see {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT android.sensor.info.colorFilterArrangement}). This is |
| 3244 | * represented as an array of Pair<Double, Double>, where |
| 3245 | * the first member of the Pair at index n is the S coefficient and the |
| 3246 | * second member is the O coefficient for the nth color channel in the CFA.</p> |
| 3247 | * <p>These coefficients are used in a two parameter noise model to describe |
| 3248 | * the amount of noise present in the image for each CFA channel. The |
| 3249 | * noise model used here is:</p> |
| 3250 | * <p>N(x) = sqrt(Sx + O)</p> |
| 3251 | * <p>Where x represents the recorded signal of a CFA channel normalized to |
| 3252 | * the range [0, 1], and S and O are the noise model coeffiecients for |
| 3253 | * that channel.</p> |
| 3254 | * <p>A more detailed description of the noise model can be found in the |
| 3255 | * Adobe DNG specification for the NoiseProfile tag.</p> |
| 3256 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 3257 | * |
| 3258 | * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT |
| 3259 | */ |
| 3260 | @PublicKey |
| 3261 | public static final Key<android.util.Pair<Double,Double>[]> SENSOR_NOISE_PROFILE = |
| 3262 | new Key<android.util.Pair<Double,Double>[]>("android.sensor.noiseProfile", new TypeReference<android.util.Pair<Double,Double>[]>() {{ }}); |
| 3263 | |
| 3264 | /** |
Ruben Brunk | 987d9f7 | 2014-02-11 18:00:24 -0800 | [diff] [blame] | 3265 | * <p>The worst-case divergence between Bayer green channels.</p> |
| 3266 | * <p>This value is an estimate of the worst case split between the |
| 3267 | * Bayer green channels in the red and blue rows in the sensor color |
| 3268 | * filter array.</p> |
| 3269 | * <p>The green split is calculated as follows:</p> |
| 3270 | * <ol> |
Ruben Brunk | e89b120 | 2014-03-24 17:10:35 -0700 | [diff] [blame] | 3271 | * <li>A 5x5 pixel (or larger) window W within the active sensor array is |
| 3272 | * chosen. The term 'pixel' here is taken to mean a group of 4 Bayer |
| 3273 | * mosaic channels (R, Gr, Gb, B). The location and size of the window |
| 3274 | * chosen is implementation defined, and should be chosen to provide a |
| 3275 | * green split estimate that is both representative of the entire image |
| 3276 | * for this camera sensor, and can be calculated quickly.</li> |
Ruben Brunk | 987d9f7 | 2014-02-11 18:00:24 -0800 | [diff] [blame] | 3277 | * <li>The arithmetic mean of the green channels from the red |
| 3278 | * rows (mean_Gr) within W is computed.</li> |
| 3279 | * <li>The arithmetic mean of the green channels from the blue |
| 3280 | * rows (mean_Gb) within W is computed.</li> |
| 3281 | * <li>The maximum ratio R of the two means is computed as follows: |
| 3282 | * <code>R = max((mean_Gr + 1)/(mean_Gb + 1), (mean_Gb + 1)/(mean_Gr + 1))</code></li> |
| 3283 | * </ol> |
| 3284 | * <p>The ratio R is the green split divergence reported for this property, |
| 3285 | * which represents how much the green channels differ in the mosaic |
| 3286 | * pattern. This value is typically used to determine the treatment of |
| 3287 | * the green mosaic channels when demosaicing.</p> |
| 3288 | * <p>The green split value can be roughly interpreted as follows:</p> |
| 3289 | * <ul> |
| 3290 | * <li>R < 1.03 is a negligible split (<3% divergence).</li> |
| 3291 | * <li>1.20 <= R >= 1.03 will require some software |
| 3292 | * correction to avoid demosaic errors (3-20% divergence).</li> |
| 3293 | * <li>R > 1.20 will require strong software correction to produce |
| 3294 | * a usuable image (>20% divergence).</li> |
| 3295 | * </ul> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3296 | * <p><b>Range of valid values:</b><br></p> |
| 3297 | * <p>>= 0</p> |
Ruben Brunk | 987d9f7 | 2014-02-11 18:00:24 -0800 | [diff] [blame] | 3298 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 3299 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 3300 | @PublicKey |
Ruben Brunk | 987d9f7 | 2014-02-11 18:00:24 -0800 | [diff] [blame] | 3301 | public static final Key<Float> SENSOR_GREEN_SPLIT = |
| 3302 | new Key<Float>("android.sensor.greenSplit", float.class); |
| 3303 | |
| 3304 | /** |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 3305 | * <p>A pixel <code>[R, G_even, G_odd, B]</code> that supplies the test pattern |
| 3306 | * when {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode} is SOLID_COLOR.</p> |
| 3307 | * <p>Each color channel is treated as an unsigned 32-bit integer. |
| 3308 | * The camera device then uses the most significant X bits |
| 3309 | * that correspond to how many bits are in its Bayer raw sensor |
| 3310 | * output.</p> |
| 3311 | * <p>For example, a sensor with RAW10 Bayer output would use the |
| 3312 | * 10 most significant bits from each color channel.</p> |
| 3313 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 3314 | * |
| 3315 | * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE |
| 3316 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 3317 | @PublicKey |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 3318 | public static final Key<int[]> SENSOR_TEST_PATTERN_DATA = |
| 3319 | new Key<int[]>("android.sensor.testPatternData", int[].class); |
| 3320 | |
| 3321 | /** |
Igor Murashkin | c127f05 | 2014-01-17 18:06:02 -0800 | [diff] [blame] | 3322 | * <p>When enabled, the sensor sends a test pattern instead of |
| 3323 | * doing a real exposure from the camera.</p> |
| 3324 | * <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] | 3325 | * by android.sensor.* will be ignored. All other controls should |
Igor Murashkin | c127f05 | 2014-01-17 18:06:02 -0800 | [diff] [blame] | 3326 | * work as normal.</p> |
| 3327 | * <p>For example, if manual flash is enabled, flash firing should still |
| 3328 | * occur (and that the test pattern remain unmodified, since the flash |
| 3329 | * would not actually affect it).</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3330 | * <p>Defaults to OFF.</p> |
| 3331 | * <p><b>Possible values:</b> |
| 3332 | * <ul> |
| 3333 | * <li>{@link #SENSOR_TEST_PATTERN_MODE_OFF OFF}</li> |
| 3334 | * <li>{@link #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR SOLID_COLOR}</li> |
| 3335 | * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS COLOR_BARS}</li> |
| 3336 | * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY COLOR_BARS_FADE_TO_GRAY}</li> |
| 3337 | * <li>{@link #SENSOR_TEST_PATTERN_MODE_PN9 PN9}</li> |
| 3338 | * <li>{@link #SENSOR_TEST_PATTERN_MODE_CUSTOM1 CUSTOM1}</li> |
| 3339 | * </ul></p> |
| 3340 | * <p><b>Available values for this device:</b><br> |
| 3341 | * {@link CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES android.sensor.availableTestPatternModes}</p> |
Igor Murashkin | c127f05 | 2014-01-17 18:06:02 -0800 | [diff] [blame] | 3342 | * <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] | 3343 | * |
| 3344 | * @see CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES |
Igor Murashkin | c127f05 | 2014-01-17 18:06:02 -0800 | [diff] [blame] | 3345 | * @see #SENSOR_TEST_PATTERN_MODE_OFF |
| 3346 | * @see #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR |
| 3347 | * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS |
| 3348 | * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY |
| 3349 | * @see #SENSOR_TEST_PATTERN_MODE_PN9 |
| 3350 | * @see #SENSOR_TEST_PATTERN_MODE_CUSTOM1 |
| 3351 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 3352 | @PublicKey |
Igor Murashkin | c127f05 | 2014-01-17 18:06:02 -0800 | [diff] [blame] | 3353 | public static final Key<Integer> SENSOR_TEST_PATTERN_MODE = |
| 3354 | new Key<Integer>("android.sensor.testPatternMode", int.class); |
| 3355 | |
| 3356 | /** |
Zhijun He | 0bda31a | 2014-06-13 14:38:39 -0700 | [diff] [blame] | 3357 | * <p>Duration between the start of first row exposure |
| 3358 | * and the start of last row exposure.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3359 | * <p>This is the exposure time skew between the first and last |
| 3360 | * row exposure start times. The first row and the last row are |
| 3361 | * the first and last rows inside of the |
| 3362 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p> |
Zhijun He | 0bda31a | 2014-06-13 14:38:39 -0700 | [diff] [blame] | 3363 | * <p>For typical camera sensors that use rolling shutters, this is also equivalent |
| 3364 | * to the frame readout time.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3365 | * <p><b>Units</b>: Nanoseconds</p> |
| 3366 | * <p><b>Range of valid values:</b><br> |
| 3367 | * >= 0 and < |
Eino-Ville Talvala | b6eb52f | 2015-04-16 16:39:45 -0700 | [diff] [blame] | 3368 | * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration }.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3369 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 3370 | * <p><b>Limited capability</b> - |
| 3371 | * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the |
| 3372 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Zhijun He | 0bda31a | 2014-06-13 14:38:39 -0700 | [diff] [blame] | 3373 | * |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3374 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Zhijun He | 0bda31a | 2014-06-13 14:38:39 -0700 | [diff] [blame] | 3375 | * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE |
| 3376 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 3377 | @PublicKey |
Zhijun He | 0bda31a | 2014-06-13 14:38:39 -0700 | [diff] [blame] | 3378 | public static final Key<Long> SENSOR_ROLLING_SHUTTER_SKEW = |
| 3379 | new Key<Long>("android.sensor.rollingShutterSkew", long.class); |
| 3380 | |
| 3381 | /** |
Zhijun He | cd950b6 | 2015-11-12 17:47:52 -0800 | [diff] [blame] | 3382 | * <p>A per-frame dynamic black level offset for each of the color filter |
| 3383 | * arrangement (CFA) mosaic channels.</p> |
| 3384 | * <p>Camera sensor black levels may vary dramatically for different |
| 3385 | * capture settings (e.g. {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}). The fixed black |
| 3386 | * level reported by {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern} may be too |
| 3387 | * inaccurate to represent the actual value on a per-frame basis. The |
| 3388 | * camera device internal pipeline relies on reliable black level values |
| 3389 | * to process the raw images appropriately. To get the best image |
| 3390 | * quality, the camera device may choose to estimate the per frame black |
| 3391 | * level values either based on optically shielded black regions |
| 3392 | * ({@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions}) or its internal model.</p> |
| 3393 | * <p>This key reports the camera device estimated per-frame zero light |
| 3394 | * value for each of the CFA mosaic channels in the camera sensor. The |
| 3395 | * {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern} may only represent a coarse |
| 3396 | * approximation of the actual black level values. This value is the |
| 3397 | * black level used in camera device internal image processing pipeline |
| 3398 | * and generally more accurate than the fixed black level values. |
| 3399 | * However, since they are estimated values by the camera device, they |
| 3400 | * may not be as accurate as the black level values calculated from the |
| 3401 | * optical black pixels reported by {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions}.</p> |
| 3402 | * <p>The values are given in the same order as channels listed for the CFA |
| 3403 | * layout key (see {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT android.sensor.info.colorFilterArrangement}), i.e. the |
| 3404 | * nth value given corresponds to the black level offset for the nth |
| 3405 | * color channel listed in the CFA.</p> |
| 3406 | * <p>This key will be available if {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions} is |
| 3407 | * available or the camera device advertises this key via |
Yin-Chia Yeh | a37d265 | 2016-04-26 14:03:29 -0700 | [diff] [blame] | 3408 | * {@link android.hardware.camera2.CameraCharacteristics#getAvailableCaptureResultKeys }.</p> |
Zhijun He | cd950b6 | 2015-11-12 17:47:52 -0800 | [diff] [blame] | 3409 | * <p><b>Range of valid values:</b><br> |
| 3410 | * >= 0 for each.</p> |
| 3411 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 3412 | * |
| 3413 | * @see CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN |
| 3414 | * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT |
| 3415 | * @see CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS |
| 3416 | * @see CaptureRequest#SENSOR_SENSITIVITY |
| 3417 | */ |
| 3418 | @PublicKey |
Zhijun He | 8998ad9 | 2015-11-24 14:31:04 -0800 | [diff] [blame] | 3419 | public static final Key<float[]> SENSOR_DYNAMIC_BLACK_LEVEL = |
| 3420 | new Key<float[]>("android.sensor.dynamicBlackLevel", float[].class); |
Zhijun He | cd950b6 | 2015-11-12 17:47:52 -0800 | [diff] [blame] | 3421 | |
| 3422 | /** |
| 3423 | * <p>Maximum raw value output by sensor for this frame.</p> |
Eino-Ville Talvala | c7c569d | 2016-04-04 10:48:38 -0700 | [diff] [blame] | 3424 | * <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] | 3425 | * capture settings (e.g., {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}), the white |
| 3426 | * level will change accordingly. This key is similar to |
| 3427 | * {@link CameraCharacteristics#SENSOR_INFO_WHITE_LEVEL android.sensor.info.whiteLevel}, but specifies the camera device |
| 3428 | * estimated white level for each frame.</p> |
| 3429 | * <p>This key will be available if {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions} is |
| 3430 | * available or the camera device advertises this key via |
| 3431 | * {@link android.hardware.camera2.CameraCharacteristics#getAvailableCaptureRequestKeys }.</p> |
| 3432 | * <p><b>Range of valid values:</b><br> |
| 3433 | * >= 0</p> |
| 3434 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 3435 | * |
Eino-Ville Talvala | c7c569d | 2016-04-04 10:48:38 -0700 | [diff] [blame] | 3436 | * @see CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN |
Zhijun He | cd950b6 | 2015-11-12 17:47:52 -0800 | [diff] [blame] | 3437 | * @see CameraCharacteristics#SENSOR_INFO_WHITE_LEVEL |
| 3438 | * @see CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS |
| 3439 | * @see CaptureRequest#SENSOR_SENSITIVITY |
| 3440 | */ |
| 3441 | @PublicKey |
| 3442 | public static final Key<Integer> SENSOR_DYNAMIC_WHITE_LEVEL = |
| 3443 | new Key<Integer>("android.sensor.dynamicWhiteLevel", int.class); |
| 3444 | |
| 3445 | /** |
Zhijun He | ba93fe6 | 2014-01-17 16:43:05 -0800 | [diff] [blame] | 3446 | * <p>Quality of lens shading correction applied |
| 3447 | * to the image data.</p> |
| 3448 | * <p>When set to OFF mode, no lens shading correction will be applied by the |
| 3449 | * camera device, and an identity lens shading map data will be provided |
| 3450 | * 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] | 3451 | * shading map with size of <code>[ 4, 3 ]</code>, |
| 3452 | * the output {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap} for this case will be an identity |
| 3453 | * map shown below:</p> |
Zhijun He | ba93fe6 | 2014-01-17 16:43:05 -0800 | [diff] [blame] | 3454 | * <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] | 3455 | * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, |
| 3456 | * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, |
| 3457 | * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, |
| 3458 | * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, |
| 3459 | * 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] | 3460 | * </code></pre> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3461 | * <p>When set to other modes, lens shading correction will be applied by the camera |
| 3462 | * device. Applications can request lens shading map data by setting |
| 3463 | * {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} to ON, and then the camera device will provide lens |
| 3464 | * shading map data in {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap}; the returned shading map |
| 3465 | * data will be the one applied by the camera device for this capture request.</p> |
| 3466 | * <p>The shading map data may depend on the auto-exposure (AE) and AWB statistics, therefore |
| 3467 | * the reliability of the map data may be affected by the AE and AWB algorithms. When AE and |
| 3468 | * 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> |
| 3469 | * OFF), to get best results, it is recommended that the applications wait for the AE and AWB |
| 3470 | * to be converged before using the returned shading map data.</p> |
| 3471 | * <p><b>Possible values:</b> |
| 3472 | * <ul> |
| 3473 | * <li>{@link #SHADING_MODE_OFF OFF}</li> |
| 3474 | * <li>{@link #SHADING_MODE_FAST FAST}</li> |
| 3475 | * <li>{@link #SHADING_MODE_HIGH_QUALITY HIGH_QUALITY}</li> |
| 3476 | * </ul></p> |
Yin-Chia Yeh | e4aa283 | 2015-02-06 15:15:53 -0800 | [diff] [blame] | 3477 | * <p><b>Available values for this device:</b><br> |
| 3478 | * {@link CameraCharacteristics#SHADING_AVAILABLE_MODES android.shading.availableModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3479 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 3480 | * <p><b>Full capability</b> - |
| 3481 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 3482 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Zhijun He | ba93fe6 | 2014-01-17 16:43:05 -0800 | [diff] [blame] | 3483 | * |
Zhijun He | fa7c755 | 2014-05-22 16:36:02 -0700 | [diff] [blame] | 3484 | * @see CaptureRequest#CONTROL_AE_MODE |
| 3485 | * @see CaptureRequest#CONTROL_AWB_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3486 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Yin-Chia Yeh | e4aa283 | 2015-02-06 15:15:53 -0800 | [diff] [blame] | 3487 | * @see CameraCharacteristics#SHADING_AVAILABLE_MODES |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3488 | * @see CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP |
Zhijun He | ba93fe6 | 2014-01-17 16:43:05 -0800 | [diff] [blame] | 3489 | * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE |
| 3490 | * @see #SHADING_MODE_OFF |
| 3491 | * @see #SHADING_MODE_FAST |
| 3492 | * @see #SHADING_MODE_HIGH_QUALITY |
Zhijun He | ba93fe6 | 2014-01-17 16:43:05 -0800 | [diff] [blame] | 3493 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 3494 | @PublicKey |
Zhijun He | ba93fe6 | 2014-01-17 16:43:05 -0800 | [diff] [blame] | 3495 | public static final Key<Integer> SHADING_MODE = |
| 3496 | new Key<Integer>("android.shading.mode", int.class); |
| 3497 | |
| 3498 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3499 | * <p>Operating mode for the face detector |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 3500 | * unit.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3501 | * <p>Whether face detection is enabled, and whether it |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3502 | * should output just the basic fields or the full set of |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3503 | * fields.</p> |
| 3504 | * <p><b>Possible values:</b> |
| 3505 | * <ul> |
| 3506 | * <li>{@link #STATISTICS_FACE_DETECT_MODE_OFF OFF}</li> |
| 3507 | * <li>{@link #STATISTICS_FACE_DETECT_MODE_SIMPLE SIMPLE}</li> |
| 3508 | * <li>{@link #STATISTICS_FACE_DETECT_MODE_FULL FULL}</li> |
| 3509 | * </ul></p> |
| 3510 | * <p><b>Available values for this device:</b><br> |
| 3511 | * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}</p> |
| 3512 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 3513 | * |
| 3514 | * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3515 | * @see #STATISTICS_FACE_DETECT_MODE_OFF |
| 3516 | * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE |
| 3517 | * @see #STATISTICS_FACE_DETECT_MODE_FULL |
| 3518 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 3519 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3520 | public static final Key<Integer> STATISTICS_FACE_DETECT_MODE = |
| 3521 | new Key<Integer>("android.statistics.faceDetectMode", int.class); |
| 3522 | |
| 3523 | /** |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 3524 | * <p>List of unique IDs for detected faces.</p> |
| 3525 | * <p>Each detected face is given a unique ID that is valid for as long as the face is visible |
| 3526 | * to the camera device. A face that leaves the field of view and later returns may be |
| 3527 | * assigned a new ID.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3528 | * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL |
| 3529 | * This key is available on all devices.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 3530 | * |
| 3531 | * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE |
Zhijun He | 7f80d6f | 2013-11-04 10:18:05 -0800 | [diff] [blame] | 3532 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3533 | */ |
| 3534 | public static final Key<int[]> STATISTICS_FACE_IDS = |
| 3535 | new Key<int[]>("android.statistics.faceIds", int[].class); |
| 3536 | |
| 3537 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3538 | * <p>List of landmarks for detected |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 3539 | * faces.</p> |
| 3540 | * <p>The coordinate system is that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with |
| 3541 | * <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] | 3542 | * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL |
| 3543 | * This key is available on all devices.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 3544 | * |
| 3545 | * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE |
| 3546 | * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE |
Zhijun He | 7f80d6f | 2013-11-04 10:18:05 -0800 | [diff] [blame] | 3547 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3548 | */ |
| 3549 | public static final Key<int[]> STATISTICS_FACE_LANDMARKS = |
| 3550 | new Key<int[]>("android.statistics.faceLandmarks", int[].class); |
| 3551 | |
| 3552 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3553 | * <p>List of the bounding rectangles for detected |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 3554 | * faces.</p> |
| 3555 | * <p>The coordinate system is that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with |
| 3556 | * <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] | 3557 | * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} != OFF |
| 3558 | * This key is available on all devices.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 3559 | * |
| 3560 | * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE |
| 3561 | * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE |
Zhijun He | 7f80d6f | 2013-11-04 10:18:05 -0800 | [diff] [blame] | 3562 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3563 | */ |
| 3564 | public static final Key<android.graphics.Rect[]> STATISTICS_FACE_RECTANGLES = |
| 3565 | new Key<android.graphics.Rect[]>("android.statistics.faceRectangles", android.graphics.Rect[].class); |
| 3566 | |
| 3567 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3568 | * <p>List of the face confidence scores for |
| 3569 | * detected faces</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 3570 | * <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] | 3571 | * <p><b>Range of valid values:</b><br> |
| 3572 | * 1-100</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3573 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 3574 | * |
| 3575 | * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE |
Zhijun He | 7f80d6f | 2013-11-04 10:18:05 -0800 | [diff] [blame] | 3576 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3577 | */ |
| 3578 | public static final Key<byte[]> STATISTICS_FACE_SCORES = |
| 3579 | new Key<byte[]>("android.statistics.faceScores", byte[].class); |
| 3580 | |
| 3581 | /** |
Igor Murashkin | 72f9f0a | 2014-05-14 15:46:10 -0700 | [diff] [blame] | 3582 | * <p>List of the faces detected through camera face detection |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3583 | * in this capture.</p> |
Igor Murashkin | 72f9f0a | 2014-05-14 15:46:10 -0700 | [diff] [blame] | 3584 | * <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] | 3585 | * <p>This key is available on all devices.</p> |
Igor Murashkin | 72f9f0a | 2014-05-14 15:46:10 -0700 | [diff] [blame] | 3586 | * |
| 3587 | * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE |
| 3588 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 3589 | @PublicKey |
| 3590 | @SyntheticKey |
Igor Murashkin | 72f9f0a | 2014-05-14 15:46:10 -0700 | [diff] [blame] | 3591 | public static final Key<android.hardware.camera2.params.Face[]> STATISTICS_FACES = |
| 3592 | new Key<android.hardware.camera2.params.Face[]>("android.statistics.faces", android.hardware.camera2.params.Face[].class); |
| 3593 | |
| 3594 | /** |
Igor Murashkin | 7a9b30e | 2013-12-11 13:31:38 -0800 | [diff] [blame] | 3595 | * <p>The shading map is a low-resolution floating-point map |
| 3596 | * that lists the coefficients used to correct for vignetting, for each |
| 3597 | * Bayer color channel.</p> |
Eino-Ville Talvala | c62cea8 | 2016-06-02 14:21:27 -0700 | [diff] [blame] | 3598 | * <p>The map provided here is the same map that is used by the camera device to |
| 3599 | * correct both color shading and vignetting for output non-RAW images.</p> |
| 3600 | * <p>When there is no lens shading correction applied to RAW |
| 3601 | * output images ({@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied} <code>==</code> |
| 3602 | * false), this map is the complete lens shading correction |
| 3603 | * map; when there is some lens shading correction applied to |
| 3604 | * 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 |
| 3605 | * correction map that needs to be applied to get shading |
| 3606 | * corrected images that match the camera device's output for |
| 3607 | * non-RAW formats.</p> |
| 3608 | * <p>For a complete shading correction map, the least shaded |
| 3609 | * section of the image will have a gain factor of 1; all |
| 3610 | * other sections will have gains above 1.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 3611 | * <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] | 3612 | * will take into account the colorCorrection settings.</p> |
Igor Murashkin | 7a9b30e | 2013-12-11 13:31:38 -0800 | [diff] [blame] | 3613 | * <p>The shading map is for the entire active pixel array, and is not |
| 3614 | * affected by the crop region specified in the request. Each shading map |
| 3615 | * entry is the value of the shading compensation map over a specific |
| 3616 | * pixel on the sensor. Specifically, with a (N x M) resolution shading |
| 3617 | * map, and an active pixel array size (W x H), shading map entry |
| 3618 | * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at |
| 3619 | * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels. |
| 3620 | * The map is assumed to be bilinearly interpolated between the sample points.</p> |
| 3621 | * <p>The channel order is [R, Geven, Godd, B], where Geven is the green |
| 3622 | * 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] | 3623 | * The shading map is stored in a fully interleaved format.</p> |
Eino-Ville Talvala | c62cea8 | 2016-06-02 14:21:27 -0700 | [diff] [blame] | 3624 | * <p>The shading map will generally have on the order of 30-40 rows and columns, |
| 3625 | * and will be smaller than 64x64.</p> |
Igor Murashkin | 7a9b30e | 2013-12-11 13:31:38 -0800 | [diff] [blame] | 3626 | * <p>As an example, given a very small map defined as:</p> |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 3627 | * <pre><code>width,height = [ 4, 3 ] |
| 3628 | * values = |
Igor Murashkin | 7a9b30e | 2013-12-11 13:31:38 -0800 | [diff] [blame] | 3629 | * [ 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] | 3630 | * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3, |
| 3631 | * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0, |
| 3632 | * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2, |
| 3633 | * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2, |
| 3634 | * 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] | 3635 | * </code></pre> |
| 3636 | * <p>The low-resolution scaling map images for each channel are |
| 3637 | * (displayed using nearest-neighbor interpolation):</p> |
| 3638 | * <p><img alt="Red lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" /> |
| 3639 | * <img alt="Green (even rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" /> |
| 3640 | * <img alt="Green (odd rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" /> |
| 3641 | * <img alt="Blue lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/blue_shading.png" /></p> |
| 3642 | * <p>As a visualization only, inverting the full-color map to recover an |
| 3643 | * image of a gray wall (using bicubic interpolation for visual quality) as captured by the sensor gives:</p> |
| 3644 | * <p><img alt="Image of a uniform white wall (inverse shading map)" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/inv_shading.png" /></p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3645 | * <p><b>Range of valid values:</b><br> |
| 3646 | * Each gain factor is >= 1</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3647 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 3648 | * <p><b>Full capability</b> - |
| 3649 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 3650 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 3651 | * |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 3652 | * @see CaptureRequest#COLOR_CORRECTION_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3653 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | c62cea8 | 2016-06-02 14:21:27 -0700 | [diff] [blame] | 3654 | * @see CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 3655 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 3656 | @PublicKey |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 3657 | public static final Key<android.hardware.camera2.params.LensShadingMap> STATISTICS_LENS_SHADING_CORRECTION_MAP = |
| 3658 | new Key<android.hardware.camera2.params.LensShadingMap>("android.statistics.lensShadingCorrectionMap", android.hardware.camera2.params.LensShadingMap.class); |
| 3659 | |
| 3660 | /** |
| 3661 | * <p>The shading map is a low-resolution floating-point map |
Zhijun He | 43210fe | 2016-04-12 23:15:23 -0700 | [diff] [blame] | 3662 | * that lists the coefficients used to correct for vignetting and color shading, |
| 3663 | * for each Bayer color channel of RAW image data.</p> |
Eino-Ville Talvala | c62cea8 | 2016-06-02 14:21:27 -0700 | [diff] [blame] | 3664 | * <p>The map provided here is the same map that is used by the camera device to |
| 3665 | * correct both color shading and vignetting for output non-RAW images.</p> |
| 3666 | * <p>When there is no lens shading correction applied to RAW |
| 3667 | * output images ({@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied} <code>==</code> |
| 3668 | * false), this map is the complete lens shading correction |
| 3669 | * map; when there is some lens shading correction applied to |
| 3670 | * 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 |
| 3671 | * correction map that needs to be applied to get shading |
| 3672 | * corrected images that match the camera device's output for |
| 3673 | * non-RAW formats.</p> |
| 3674 | * <p>For a complete shading correction map, the least shaded |
| 3675 | * section of the image will have a gain factor of 1; all |
| 3676 | * other sections will have gains above 1.</p> |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 3677 | * <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] | 3678 | * will take into account the colorCorrection settings.</p> |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 3679 | * <p>The shading map is for the entire active pixel array, and is not |
| 3680 | * affected by the crop region specified in the request. Each shading map |
| 3681 | * entry is the value of the shading compensation map over a specific |
| 3682 | * pixel on the sensor. Specifically, with a (N x M) resolution shading |
| 3683 | * map, and an active pixel array size (W x H), shading map entry |
| 3684 | * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at |
| 3685 | * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels. |
| 3686 | * The map is assumed to be bilinearly interpolated between the sample points.</p> |
| 3687 | * <p>The channel order is [R, Geven, Godd, B], where Geven is the green |
| 3688 | * channel for the even rows of a Bayer pattern, and Godd is the odd rows. |
| 3689 | * The shading map is stored in a fully interleaved format, and its size |
| 3690 | * 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] | 3691 | * <p>The shading map will generally have on the order of 30-40 rows and columns, |
| 3692 | * and will be smaller than 64x64.</p> |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 3693 | * <p>As an example, given a very small map defined as:</p> |
| 3694 | * <pre><code>android.lens.info.shadingMapSize = [ 4, 3 ] |
| 3695 | * android.statistics.lensShadingMap = |
| 3696 | * [ 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] | 3697 | * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3, |
| 3698 | * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0, |
| 3699 | * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2, |
| 3700 | * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2, |
| 3701 | * 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] | 3702 | * </code></pre> |
| 3703 | * <p>The low-resolution scaling map images for each channel are |
| 3704 | * (displayed using nearest-neighbor interpolation):</p> |
| 3705 | * <p><img alt="Red lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" /> |
| 3706 | * <img alt="Green (even rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" /> |
| 3707 | * <img alt="Green (odd rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" /> |
| 3708 | * <img alt="Blue lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/blue_shading.png" /></p> |
| 3709 | * <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] | 3710 | * image of a gray wall (using bicubic interpolation for visual quality) |
| 3711 | * as captured by the sensor gives:</p> |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 3712 | * <p><img alt="Image of a uniform white wall (inverse shading map)" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/inv_shading.png" /></p> |
Yin-Chia Yeh | e4aa283 | 2015-02-06 15:15:53 -0800 | [diff] [blame] | 3713 | * <p>Note that the RAW image data might be subject to lens shading |
| 3714 | * correction not reported on this map. Query |
| 3715 | * {@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied} to see if RAW image data has subject |
| 3716 | * to lens shading correction. If {@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied} |
| 3717 | * is TRUE, the RAW image data is subject to partial or full lens shading |
| 3718 | * correction. In the case full lens shading correction is applied to RAW |
| 3719 | * images, the gain factor map reported in this key will contain all 1.0 gains. |
| 3720 | * In other words, the map reported in this key is the remaining lens shading |
| 3721 | * that needs to be applied on the RAW image to get images without lens shading |
| 3722 | * artifacts. See {@link CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_RAW android.request.maxNumOutputRaw} for a list of RAW image |
| 3723 | * formats.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3724 | * <p><b>Range of valid values:</b><br> |
| 3725 | * Each gain factor is >= 1</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3726 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 3727 | * <p><b>Full capability</b> - |
| 3728 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 3729 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 3730 | * |
| 3731 | * @see CaptureRequest#COLOR_CORRECTION_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3732 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Yin-Chia Yeh | e4aa283 | 2015-02-06 15:15:53 -0800 | [diff] [blame] | 3733 | * @see CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_RAW |
| 3734 | * @see CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 3735 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3736 | */ |
| 3737 | public static final Key<float[]> STATISTICS_LENS_SHADING_MAP = |
| 3738 | new Key<float[]>("android.statistics.lensShadingMap", float[].class); |
| 3739 | |
| 3740 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3741 | * <p>The best-fit color channel gains calculated |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 3742 | * 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] | 3743 | * <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] | 3744 | * since statistics processing on data from a new frame |
| 3745 | * typically completes after the transform has already been |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3746 | * applied to that frame.</p> |
| 3747 | * <p>The 4 channel gains are defined in Bayer domain, |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 3748 | * 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] | 3749 | * <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] | 3750 | * regardless of the android.control.* current values.</p> |
Igor Murashkin | aef3b7e | 2014-01-15 13:20:37 -0800 | [diff] [blame] | 3751 | * <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] | 3752 | * |
| 3753 | * @see CaptureRequest#COLOR_CORRECTION_GAINS |
Igor Murashkin | 9c59517 | 2014-05-12 13:56:20 -0700 | [diff] [blame] | 3754 | * @deprecated |
Igor Murashkin | aef3b7e | 2014-01-15 13:20:37 -0800 | [diff] [blame] | 3755 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3756 | */ |
Igor Murashkin | 9c59517 | 2014-05-12 13:56:20 -0700 | [diff] [blame] | 3757 | @Deprecated |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3758 | public static final Key<float[]> STATISTICS_PREDICTED_COLOR_GAINS = |
| 3759 | new Key<float[]>("android.statistics.predictedColorGains", float[].class); |
| 3760 | |
| 3761 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3762 | * <p>The best-fit color transform matrix estimate |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 3763 | * calculated by the camera device's statistics units for the current |
| 3764 | * output frame.</p> |
| 3765 | * <p>The camera device will provide the estimate from its |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3766 | * statistics unit on the white balance transforms to use |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 3767 | * 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] | 3768 | * are the best fit for the current output frame. This may |
| 3769 | * be different than the transform used for this frame, since |
| 3770 | * statistics processing on data from a new frame typically |
| 3771 | * completes after the transform has already been applied to |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3772 | * that frame.</p> |
| 3773 | * <p>These estimates must be provided for all frames, even if |
| 3774 | * capture settings and color transforms are set by the application.</p> |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 3775 | * <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] | 3776 | * regardless of the android.control.* current values.</p> |
Igor Murashkin | aef3b7e | 2014-01-15 13:20:37 -0800 | [diff] [blame] | 3777 | * <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] | 3778 | * @deprecated |
Igor Murashkin | aef3b7e | 2014-01-15 13:20:37 -0800 | [diff] [blame] | 3779 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3780 | */ |
Igor Murashkin | 9c59517 | 2014-05-12 13:56:20 -0700 | [diff] [blame] | 3781 | @Deprecated |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3782 | public static final Key<Rational[]> STATISTICS_PREDICTED_COLOR_TRANSFORM = |
| 3783 | new Key<Rational[]>("android.statistics.predictedColorTransform", Rational[].class); |
| 3784 | |
| 3785 | /** |
Zhijun He | 208fb6c | 2014-02-03 13:09:06 -0800 | [diff] [blame] | 3786 | * <p>The camera device estimated scene illumination lighting |
| 3787 | * frequency.</p> |
| 3788 | * <p>Many light sources, such as most fluorescent lights, flicker at a rate |
| 3789 | * that depends on the local utility power standards. This flicker must be |
| 3790 | * accounted for by auto-exposure routines to avoid artifacts in captured images. |
| 3791 | * The camera device uses this entry to tell the application what the scene |
| 3792 | * illuminant frequency is.</p> |
| 3793 | * <p>When manual exposure control is enabled |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 3794 | * (<code>{@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} == OFF</code> or <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == |
| 3795 | * OFF</code>), the {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} doesn't perform |
| 3796 | * antibanding, and the application can ensure it selects |
| 3797 | * exposure times that do not cause banding issues by looking |
| 3798 | * into this metadata field. See |
| 3799 | * {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} for more details.</p> |
| 3800 | * <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] | 3801 | * <p><b>Possible values:</b> |
| 3802 | * <ul> |
| 3803 | * <li>{@link #STATISTICS_SCENE_FLICKER_NONE NONE}</li> |
| 3804 | * <li>{@link #STATISTICS_SCENE_FLICKER_50HZ 50HZ}</li> |
| 3805 | * <li>{@link #STATISTICS_SCENE_FLICKER_60HZ 60HZ}</li> |
| 3806 | * </ul></p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3807 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 3808 | * <p><b>Full capability</b> - |
| 3809 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 3810 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Zhijun He | 208fb6c | 2014-02-03 13:09:06 -0800 | [diff] [blame] | 3811 | * |
| 3812 | * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE |
| 3813 | * @see CaptureRequest#CONTROL_AE_MODE |
| 3814 | * @see CaptureRequest#CONTROL_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3815 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3816 | * @see #STATISTICS_SCENE_FLICKER_NONE |
| 3817 | * @see #STATISTICS_SCENE_FLICKER_50HZ |
| 3818 | * @see #STATISTICS_SCENE_FLICKER_60HZ |
| 3819 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 3820 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3821 | public static final Key<Integer> STATISTICS_SCENE_FLICKER = |
| 3822 | new Key<Integer>("android.statistics.sceneFlicker", int.class); |
| 3823 | |
| 3824 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3825 | * <p>Operating mode for hot pixel map generation.</p> |
| 3826 | * <p>If set to <code>true</code>, a hot pixel map is returned in {@link CaptureResult#STATISTICS_HOT_PIXEL_MAP android.statistics.hotPixelMap}. |
| 3827 | * If set to <code>false</code>, no hot pixel map will be returned.</p> |
| 3828 | * <p><b>Range of valid values:</b><br> |
| 3829 | * {@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] | 3830 | * <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] | 3831 | * |
| 3832 | * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP |
| 3833 | * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES |
| 3834 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 3835 | @PublicKey |
Ruben Brunk | 9d454fd | 2014-03-04 14:11:52 -0800 | [diff] [blame] | 3836 | public static final Key<Boolean> STATISTICS_HOT_PIXEL_MAP_MODE = |
| 3837 | new Key<Boolean>("android.statistics.hotPixelMapMode", boolean.class); |
| 3838 | |
| 3839 | /** |
| 3840 | * <p>List of <code>(x, y)</code> coordinates of hot/defective pixels on the sensor.</p> |
| 3841 | * <p>A coordinate <code>(x, y)</code> must lie between <code>(0, 0)</code>, and |
| 3842 | * <code>(width - 1, height - 1)</code> (inclusive), which are the top-left and |
| 3843 | * bottom-right of the pixel array, respectively. The width and |
| 3844 | * height dimensions are given in {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}. |
| 3845 | * This may include hot pixels that lie outside of the active array |
| 3846 | * 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] | 3847 | * <p><b>Range of valid values:</b><br></p> |
| 3848 | * <p>n <= number of pixels on the sensor. |
| 3849 | * The <code>(x, y)</code> coordinates must be bounded by |
| 3850 | * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3851 | * <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] | 3852 | * |
| 3853 | * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE |
| 3854 | * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE |
| 3855 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 3856 | @PublicKey |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 3857 | public static final Key<android.graphics.Point[]> STATISTICS_HOT_PIXEL_MAP = |
| 3858 | new Key<android.graphics.Point[]>("android.statistics.hotPixelMap", android.graphics.Point[].class); |
Ruben Brunk | 9d454fd | 2014-03-04 14:11:52 -0800 | [diff] [blame] | 3859 | |
| 3860 | /** |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 3861 | * <p>Whether the camera device will output the lens |
| 3862 | * shading map in output result metadata.</p> |
| 3863 | * <p>When set to ON, |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 3864 | * android.statistics.lensShadingMap will be provided in |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 3865 | * the output result metadata.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3866 | * <p>ON is always supported on devices with the RAW capability.</p> |
| 3867 | * <p><b>Possible values:</b> |
| 3868 | * <ul> |
| 3869 | * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_OFF OFF}</li> |
| 3870 | * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_ON ON}</li> |
| 3871 | * </ul></p> |
Yin-Chia Yeh | e4aa283 | 2015-02-06 15:15:53 -0800 | [diff] [blame] | 3872 | * <p><b>Available values for this device:</b><br> |
| 3873 | * {@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] | 3874 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 3875 | * <p><b>Full capability</b> - |
| 3876 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 3877 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
| 3878 | * |
| 3879 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Yin-Chia Yeh | e4aa283 | 2015-02-06 15:15:53 -0800 | [diff] [blame] | 3880 | * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 3881 | * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF |
| 3882 | * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON |
| 3883 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 3884 | @PublicKey |
Zhijun He | 379af01 | 2014-05-06 11:54:54 -0700 | [diff] [blame] | 3885 | public static final Key<Integer> STATISTICS_LENS_SHADING_MAP_MODE = |
| 3886 | new Key<Integer>("android.statistics.lensShadingMapMode", int.class); |
| 3887 | |
| 3888 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3889 | * <p>Tonemapping / contrast / gamma curve for the blue |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 3890 | * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is |
| 3891 | * CONTRAST_CURVE.</p> |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 3892 | * <p>See android.tonemap.curveRed for more details.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3893 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 3894 | * <p><b>Full capability</b> - |
| 3895 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 3896 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 3897 | * |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3898 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 3899 | * @see CaptureRequest#TONEMAP_MODE |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 3900 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3901 | */ |
Zhijun He | 3ffd705 | 2013-08-19 15:45:08 -0700 | [diff] [blame] | 3902 | public static final Key<float[]> TONEMAP_CURVE_BLUE = |
| 3903 | new Key<float[]>("android.tonemap.curveBlue", float[].class); |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3904 | |
| 3905 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3906 | * <p>Tonemapping / contrast / gamma curve for the green |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 3907 | * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is |
| 3908 | * CONTRAST_CURVE.</p> |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 3909 | * <p>See android.tonemap.curveRed for more details.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3910 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 3911 | * <p><b>Full capability</b> - |
| 3912 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 3913 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 3914 | * |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3915 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 3916 | * @see CaptureRequest#TONEMAP_MODE |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 3917 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3918 | */ |
Zhijun He | 3ffd705 | 2013-08-19 15:45:08 -0700 | [diff] [blame] | 3919 | public static final Key<float[]> TONEMAP_CURVE_GREEN = |
| 3920 | new Key<float[]>("android.tonemap.curveGreen", float[].class); |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3921 | |
| 3922 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 3923 | * <p>Tonemapping / contrast / gamma curve for the red |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 3924 | * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is |
| 3925 | * CONTRAST_CURVE.</p> |
| 3926 | * <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] | 3927 | * <pre><code>android.tonemap.curveRed = |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3928 | * [ P0in, P0out, P1in, P1out, P2in, P2out, P3in, P3out, ..., PNin, PNout ] |
Zhijun He | 870922b | 2014-02-15 21:47:51 -0800 | [diff] [blame] | 3929 | * 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] | 3930 | * <p>These are sorted in order of increasing <code>Pin</code>; it is |
| 3931 | * 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] | 3932 | * define a complete mapping. For input values between control points, |
| 3933 | * the camera device must linearly interpolate between the control |
| 3934 | * points.</p> |
| 3935 | * <p>Each curve can have an independent number of points, and the number |
| 3936 | * of points can be less than max (that is, the request doesn't have to |
| 3937 | * always provide a curve with number of points equivalent to |
| 3938 | * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p> |
| 3939 | * <p>A few examples, and their corresponding graphical mappings; these |
| 3940 | * only specify the red channel and the precision is limited to 4 |
| 3941 | * digits, for conciseness.</p> |
| 3942 | * <p>Linear mapping:</p> |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 3943 | * <pre><code>android.tonemap.curveRed = [ 0, 0, 1.0, 1.0 ] |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 3944 | * </code></pre> |
| 3945 | * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p> |
| 3946 | * <p>Invert mapping:</p> |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 3947 | * <pre><code>android.tonemap.curveRed = [ 0, 1.0, 1.0, 0 ] |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 3948 | * </code></pre> |
| 3949 | * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p> |
| 3950 | * <p>Gamma 1/2.2 mapping, with 16 control points:</p> |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 3951 | * <pre><code>android.tonemap.curveRed = [ |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3952 | * 0.0000, 0.0000, 0.0667, 0.2920, 0.1333, 0.4002, 0.2000, 0.4812, |
| 3953 | * 0.2667, 0.5484, 0.3333, 0.6069, 0.4000, 0.6594, 0.4667, 0.7072, |
| 3954 | * 0.5333, 0.7515, 0.6000, 0.7928, 0.6667, 0.8317, 0.7333, 0.8685, |
| 3955 | * 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] | 3956 | * </code></pre> |
| 3957 | * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p> |
| 3958 | * <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] | 3959 | * <pre><code>android.tonemap.curveRed = [ |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3960 | * 0.0000, 0.0000, 0.0667, 0.2864, 0.1333, 0.4007, 0.2000, 0.4845, |
| 3961 | * 0.2667, 0.5532, 0.3333, 0.6125, 0.4000, 0.6652, 0.4667, 0.7130, |
| 3962 | * 0.5333, 0.7569, 0.6000, 0.7977, 0.6667, 0.8360, 0.7333, 0.8721, |
| 3963 | * 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] | 3964 | * </code></pre> |
| 3965 | * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3966 | * <p><b>Range of valid values:</b><br> |
| 3967 | * 0-1 on both input and output coordinates, normalized |
| 3968 | * 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] | 3969 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 3970 | * <p><b>Full capability</b> - |
| 3971 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 3972 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 3973 | * |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 3974 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 3975 | * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 3976 | * @see CaptureRequest#TONEMAP_MODE |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 3977 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 3978 | */ |
| 3979 | public static final Key<float[]> TONEMAP_CURVE_RED = |
| 3980 | new Key<float[]>("android.tonemap.curveRed", float[].class); |
| 3981 | |
| 3982 | /** |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 3983 | * <p>Tonemapping / contrast / gamma curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} |
| 3984 | * is CONTRAST_CURVE.</p> |
| 3985 | * <p>The tonemapCurve consist of three curves for each of red, green, and blue |
| 3986 | * channels respectively. The following example uses the red channel as an |
| 3987 | * example. The same logic applies to green and blue channel. |
| 3988 | * Each channel's curve is defined by an array of control points:</p> |
| 3989 | * <pre><code>curveRed = |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 3990 | * [ 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] | 3991 | * 2 <= N <= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre> |
| 3992 | * <p>These are sorted in order of increasing <code>Pin</code>; it is always |
| 3993 | * guaranteed that input values 0.0 and 1.0 are included in the list to |
| 3994 | * define a complete mapping. For input values between control points, |
| 3995 | * the camera device must linearly interpolate between the control |
| 3996 | * points.</p> |
| 3997 | * <p>Each curve can have an independent number of points, and the number |
| 3998 | * of points can be less than max (that is, the request doesn't have to |
| 3999 | * always provide a curve with number of points equivalent to |
| 4000 | * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p> |
| 4001 | * <p>A few examples, and their corresponding graphical mappings; these |
| 4002 | * only specify the red channel and the precision is limited to 4 |
| 4003 | * digits, for conciseness.</p> |
| 4004 | * <p>Linear mapping:</p> |
| 4005 | * <pre><code>curveRed = [ (0, 0), (1.0, 1.0) ] |
| 4006 | * </code></pre> |
| 4007 | * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p> |
| 4008 | * <p>Invert mapping:</p> |
| 4009 | * <pre><code>curveRed = [ (0, 1.0), (1.0, 0) ] |
| 4010 | * </code></pre> |
| 4011 | * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p> |
| 4012 | * <p>Gamma 1/2.2 mapping, with 16 control points:</p> |
| 4013 | * <pre><code>curveRed = [ |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 4014 | * (0.0000, 0.0000), (0.0667, 0.2920), (0.1333, 0.4002), (0.2000, 0.4812), |
| 4015 | * (0.2667, 0.5484), (0.3333, 0.6069), (0.4000, 0.6594), (0.4667, 0.7072), |
| 4016 | * (0.5333, 0.7515), (0.6000, 0.7928), (0.6667, 0.8317), (0.7333, 0.8685), |
| 4017 | * (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] | 4018 | * </code></pre> |
| 4019 | * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p> |
| 4020 | * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p> |
| 4021 | * <pre><code>curveRed = [ |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 4022 | * (0.0000, 0.0000), (0.0667, 0.2864), (0.1333, 0.4007), (0.2000, 0.4845), |
| 4023 | * (0.2667, 0.5532), (0.3333, 0.6125), (0.4000, 0.6652), (0.4667, 0.7130), |
| 4024 | * (0.5333, 0.7569), (0.6000, 0.7977), (0.6667, 0.8360), (0.7333, 0.8721), |
| 4025 | * (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] | 4026 | * </code></pre> |
| 4027 | * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 4028 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 4029 | * <p><b>Full capability</b> - |
| 4030 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 4031 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 4032 | * |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 4033 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 4034 | * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS |
| 4035 | * @see CaptureRequest#TONEMAP_MODE |
| 4036 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 4037 | @PublicKey |
| 4038 | @SyntheticKey |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 4039 | public static final Key<android.hardware.camera2.params.TonemapCurve> TONEMAP_CURVE = |
| 4040 | new Key<android.hardware.camera2.params.TonemapCurve>("android.tonemap.curve", android.hardware.camera2.params.TonemapCurve.class); |
| 4041 | |
| 4042 | /** |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 4043 | * <p>High-level global contrast/gamma/tonemapping control.</p> |
| 4044 | * <p>When switching to an application-defined contrast curve by setting |
| 4045 | * {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} to CONTRAST_CURVE, the curve is defined |
| 4046 | * per-channel with a set of <code>(in, out)</code> points that specify the |
| 4047 | * mapping from input high-bit-depth pixel value to the output |
| 4048 | * low-bit-depth value. Since the actual pixel ranges of both input |
| 4049 | * and output may change depending on the camera pipeline, the values |
| 4050 | * are specified by normalized floating-point numbers.</p> |
| 4051 | * <p>More-complex color mapping operations such as 3D color look-up |
| 4052 | * tables, selective chroma enhancement, or other non-linear color |
| 4053 | * transforms will be disabled when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is |
| 4054 | * CONTRAST_CURVE.</p> |
| 4055 | * <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] | 4056 | * 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] | 4057 | * These values are always available, and as close as possible to the |
| 4058 | * actually used nonlinear/nonglobal transforms.</p> |
Zhijun He | fa7c755 | 2014-05-22 16:36:02 -0700 | [diff] [blame] | 4059 | * <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] | 4060 | * provided curve in FAST or HIGH_QUALITY, the image's tonemap will be |
| 4061 | * roughly the same.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 4062 | * <p><b>Possible values:</b> |
| 4063 | * <ul> |
| 4064 | * <li>{@link #TONEMAP_MODE_CONTRAST_CURVE CONTRAST_CURVE}</li> |
| 4065 | * <li>{@link #TONEMAP_MODE_FAST FAST}</li> |
| 4066 | * <li>{@link #TONEMAP_MODE_HIGH_QUALITY HIGH_QUALITY}</li> |
Yin-Chia Yeh | 956c52b | 2015-02-06 11:23:25 -0800 | [diff] [blame] | 4067 | * <li>{@link #TONEMAP_MODE_GAMMA_VALUE GAMMA_VALUE}</li> |
| 4068 | * <li>{@link #TONEMAP_MODE_PRESET_CURVE PRESET_CURVE}</li> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 4069 | * </ul></p> |
| 4070 | * <p><b>Available values for this device:</b><br> |
| 4071 | * {@link CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES android.tonemap.availableToneMapModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 4072 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 4073 | * <p><b>Full capability</b> - |
| 4074 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 4075 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Igor Murashkin | 3242f4f | 2014-01-15 12:27:41 -0800 | [diff] [blame] | 4076 | * |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 4077 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Ruben Brunk | 6dc379c | 2014-03-04 15:04:00 -0800 | [diff] [blame] | 4078 | * @see CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 4079 | * @see CaptureRequest#TONEMAP_CURVE |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 4080 | * @see CaptureRequest#TONEMAP_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 4081 | * @see #TONEMAP_MODE_CONTRAST_CURVE |
| 4082 | * @see #TONEMAP_MODE_FAST |
| 4083 | * @see #TONEMAP_MODE_HIGH_QUALITY |
Yin-Chia Yeh | 956c52b | 2015-02-06 11:23:25 -0800 | [diff] [blame] | 4084 | * @see #TONEMAP_MODE_GAMMA_VALUE |
| 4085 | * @see #TONEMAP_MODE_PRESET_CURVE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 4086 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 4087 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 4088 | public static final Key<Integer> TONEMAP_MODE = |
| 4089 | new Key<Integer>("android.tonemap.mode", int.class); |
| 4090 | |
| 4091 | /** |
Yin-Chia Yeh | 956c52b | 2015-02-06 11:23:25 -0800 | [diff] [blame] | 4092 | * <p>Tonemapping curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is |
| 4093 | * GAMMA_VALUE</p> |
| 4094 | * <p>The tonemap curve will be defined the following formula: |
| 4095 | * * OUT = pow(IN, 1.0 / gamma) |
| 4096 | * where IN and OUT is the input pixel value scaled to range [0.0, 1.0], |
| 4097 | * pow is the power function and gamma is the gamma value specified by this |
| 4098 | * key.</p> |
| 4099 | * <p>The same curve will be applied to all color channels. The camera device |
| 4100 | * may clip the input gamma value to its supported range. The actual applied |
| 4101 | * value will be returned in capture result.</p> |
| 4102 | * <p>The valid range of gamma value varies on different devices, but values |
| 4103 | * within [1.0, 5.0] are guaranteed not to be clipped.</p> |
| 4104 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 4105 | * |
| 4106 | * @see CaptureRequest#TONEMAP_MODE |
| 4107 | */ |
| 4108 | @PublicKey |
| 4109 | public static final Key<Float> TONEMAP_GAMMA = |
| 4110 | new Key<Float>("android.tonemap.gamma", float.class); |
| 4111 | |
| 4112 | /** |
| 4113 | * <p>Tonemapping curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is |
| 4114 | * PRESET_CURVE</p> |
| 4115 | * <p>The tonemap curve will be defined by specified standard.</p> |
| 4116 | * <p>sRGB (approximated by 16 control points):</p> |
| 4117 | * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p> |
| 4118 | * <p>Rec. 709 (approximated by 16 control points):</p> |
| 4119 | * <p><img alt="Rec. 709 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/rec709_tonemap.png" /></p> |
| 4120 | * <p>Note that above figures show a 16 control points approximation of preset |
| 4121 | * curves. Camera devices may apply a different approximation to the curve.</p> |
| 4122 | * <p><b>Possible values:</b> |
| 4123 | * <ul> |
| 4124 | * <li>{@link #TONEMAP_PRESET_CURVE_SRGB SRGB}</li> |
| 4125 | * <li>{@link #TONEMAP_PRESET_CURVE_REC709 REC709}</li> |
| 4126 | * </ul></p> |
| 4127 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 4128 | * |
| 4129 | * @see CaptureRequest#TONEMAP_MODE |
| 4130 | * @see #TONEMAP_PRESET_CURVE_SRGB |
| 4131 | * @see #TONEMAP_PRESET_CURVE_REC709 |
| 4132 | */ |
| 4133 | @PublicKey |
| 4134 | public static final Key<Integer> TONEMAP_PRESET_CURVE = |
| 4135 | new Key<Integer>("android.tonemap.presetCurve", int.class); |
| 4136 | |
| 4137 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 4138 | * <p>This LED is nominally used to indicate to the user |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 4139 | * that the camera is powered on and may be streaming images back to the |
| 4140 | * Application Processor. In certain rare circumstances, the OS may |
| 4141 | * disable this when video is processed locally and not transmitted to |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 4142 | * any untrusted applications.</p> |
| 4143 | * <p>In particular, the LED <em>must</em> always be on when the data could be |
| 4144 | * transmitted off the device. The LED <em>should</em> always be on whenever |
| 4145 | * data is stored locally on the device.</p> |
| 4146 | * <p>The LED <em>may</em> be off if a trusted application is using the data that |
| 4147 | * doesn't violate the above rules.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 4148 | * <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] | 4149 | * @hide |
| 4150 | */ |
| 4151 | public static final Key<Boolean> LED_TRANSMIT = |
| 4152 | new Key<Boolean>("android.led.transmit", boolean.class); |
| 4153 | |
| 4154 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 4155 | * <p>Whether black-level compensation is locked |
Eino-Ville Talvala | 0956af5 | 2013-12-26 13:19:10 -0800 | [diff] [blame] | 4156 | * to its current values, or is free to vary.</p> |
| 4157 | * <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] | 4158 | * 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] | 4159 | * a change in other capture settings forced the camera device to |
| 4160 | * perform a black level reset.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 4161 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 4162 | * <p><b>Full capability</b> - |
| 4163 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 4164 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 4165 | * |
| 4166 | * @see CaptureRequest#BLACK_LEVEL_LOCK |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 4167 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 4168 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 4169 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 4170 | public static final Key<Boolean> BLACK_LEVEL_LOCK = |
| 4171 | new Key<Boolean>("android.blackLevel.lock", boolean.class); |
| 4172 | |
Igor Murashkin | 3865a84 | 2014-01-17 18:18:39 -0800 | [diff] [blame] | 4173 | /** |
| 4174 | * <p>The frame number corresponding to the last request |
| 4175 | * with which the output result (metadata + buffers) has been fully |
| 4176 | * synchronized.</p> |
| 4177 | * <p>When a request is submitted to the camera device, there is usually a |
| 4178 | * delay of several frames before the controls get applied. A camera |
| 4179 | * device may either choose to account for this delay by implementing a |
| 4180 | * pipeline and carefully submit well-timed atomic control updates, or |
| 4181 | * it may start streaming control changes that span over several frame |
| 4182 | * boundaries.</p> |
| 4183 | * <p>In the latter case, whenever a request's settings change relative to |
| 4184 | * the previous submitted request, the full set of changes may take |
| 4185 | * multiple frame durations to fully take effect. Some settings may |
| 4186 | * take effect sooner (in less frame durations) than others.</p> |
| 4187 | * <p>While a set of control changes are being propagated, this value |
| 4188 | * will be CONVERGING.</p> |
| 4189 | * <p>Once it is fully known that a set of control changes have been |
| 4190 | * finished propagating, and the resulting updated control settings |
| 4191 | * have been read back by the camera device, this value will be set |
| 4192 | * to a non-negative frame number (corresponding to the request to |
| 4193 | * which the results have synchronized to).</p> |
| 4194 | * <p>Older camera device implementations may not have a way to detect |
| 4195 | * when all camera controls have been applied, and will always set this |
| 4196 | * value to UNKNOWN.</p> |
| 4197 | * <p>FULL capability devices will always have this value set to the |
| 4198 | * frame number of the request corresponding to this result.</p> |
| 4199 | * <p><em>Further details</em>:</p> |
| 4200 | * <ul> |
| 4201 | * <li>Whenever a request differs from the last request, any future |
| 4202 | * results not yet returned may have this value set to CONVERGING (this |
| 4203 | * could include any in-progress captures not yet returned by the camera |
| 4204 | * device, for more details see pipeline considerations below).</li> |
| 4205 | * <li>Submitting a series of multiple requests that differ from the |
| 4206 | * previous request (e.g. r1, r2, r3 s.t. r1 != r2 != r3) |
| 4207 | * moves the new synchronization frame to the last non-repeating |
| 4208 | * request (using the smallest frame number from the contiguous list of |
| 4209 | * repeating requests).</li> |
| 4210 | * <li>Submitting the same request repeatedly will not change this value |
| 4211 | * to CONVERGING, if it was already a non-negative value.</li> |
| 4212 | * <li>When this value changes to non-negative, that means that all of the |
| 4213 | * metadata controls from the request have been applied, all of the |
| 4214 | * metadata controls from the camera device have been read to the |
| 4215 | * updated values (into the result), and all of the graphics buffers |
| 4216 | * corresponding to this result are also synchronized to the request.</li> |
| 4217 | * </ul> |
| 4218 | * <p><em>Pipeline considerations</em>:</p> |
| 4219 | * <p>Submitting a request with updated controls relative to the previously |
| 4220 | * submitted requests may also invalidate the synchronization state |
| 4221 | * of all the results corresponding to currently in-flight requests.</p> |
| 4222 | * <p>In other words, results for this current request and up to |
| 4223 | * {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} prior requests may have their |
| 4224 | * android.sync.frameNumber change to CONVERGING.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 4225 | * <p><b>Possible values:</b> |
| 4226 | * <ul> |
| 4227 | * <li>{@link #SYNC_FRAME_NUMBER_CONVERGING CONVERGING}</li> |
| 4228 | * <li>{@link #SYNC_FRAME_NUMBER_UNKNOWN UNKNOWN}</li> |
| 4229 | * </ul></p> |
| 4230 | * <p><b>Available values for this device:</b><br> |
| 4231 | * Either a non-negative value corresponding to a |
| 4232 | * <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] | 4233 | * <p>This key is available on all devices.</p> |
Igor Murashkin | 3865a84 | 2014-01-17 18:18:39 -0800 | [diff] [blame] | 4234 | * |
| 4235 | * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH |
| 4236 | * @see #SYNC_FRAME_NUMBER_CONVERGING |
| 4237 | * @see #SYNC_FRAME_NUMBER_UNKNOWN |
| 4238 | * @hide |
| 4239 | */ |
Zhijun He | 4f91e2a | 2014-04-17 13:20:21 -0700 | [diff] [blame] | 4240 | public static final Key<Long> SYNC_FRAME_NUMBER = |
| 4241 | new Key<Long>("android.sync.frameNumber", long.class); |
Igor Murashkin | 3865a84 | 2014-01-17 18:18:39 -0800 | [diff] [blame] | 4242 | |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 4243 | /** |
| 4244 | * <p>The amount of exposure time increase factor applied to the original output |
| 4245 | * frame by the application processing before sending for reprocessing.</p> |
| 4246 | * <p>This is optional, and will be supported if the camera device supports YUV_REPROCESSING |
| 4247 | * capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains YUV_REPROCESSING).</p> |
| 4248 | * <p>For some YUV reprocessing use cases, the application may choose to filter the original |
| 4249 | * output frames to effectively reduce the noise to the same level as a frame that was |
| 4250 | * captured with longer exposure time. To be more specific, assuming the original captured |
| 4251 | * images were captured with a sensitivity of S and an exposure time of T, the model in |
| 4252 | * the camera device is that the amount of noise in the image would be approximately what |
| 4253 | * would be expected if the original capture parameters had been a sensitivity of |
| 4254 | * S/effectiveExposureFactor and an exposure time of T*effectiveExposureFactor, rather |
| 4255 | * than S and T respectively. If the captured images were processed by the application |
| 4256 | * before being sent for reprocessing, then the application may have used image processing |
| 4257 | * algorithms and/or multi-frame image fusion to reduce the noise in the |
| 4258 | * application-processed images (input images). By using the effectiveExposureFactor |
| 4259 | * control, the application can communicate to the camera device the actual noise level |
| 4260 | * improvement in the application-processed image. With this information, the camera |
| 4261 | * device can select appropriate noise reduction and edge enhancement parameters to avoid |
| 4262 | * excessive noise reduction ({@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode}) and insufficient edge |
| 4263 | * enhancement ({@link CaptureRequest#EDGE_MODE android.edge.mode}) being applied to the reprocessed frames.</p> |
| 4264 | * <p>For example, for multi-frame image fusion use case, the application may fuse |
| 4265 | * multiple output frames together to a final frame for reprocessing. When N image are |
| 4266 | * fused into 1 image for reprocessing, the exposure time increase factor could be up to |
| 4267 | * square root of N (based on a simple photon shot noise model). The camera device will |
| 4268 | * adjust the reprocessing noise reduction and edge enhancement parameters accordingly to |
| 4269 | * produce the best quality images.</p> |
| 4270 | * <p>This is relative factor, 1.0 indicates the application hasn't processed the input |
| 4271 | * buffer in a way that affects its effective exposure time.</p> |
| 4272 | * <p>This control is only effective for YUV reprocessing capture request. For noise |
| 4273 | * reduction reprocessing, it is only effective when <code>{@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode} != OFF</code>. |
| 4274 | * Similarly, for edge enhancement reprocessing, it is only effective when |
| 4275 | * <code>{@link CaptureRequest#EDGE_MODE android.edge.mode} != OFF</code>.</p> |
| 4276 | * <p><b>Units</b>: Relative exposure time increase factor.</p> |
| 4277 | * <p><b>Range of valid values:</b><br> |
| 4278 | * >= 1.0</p> |
| 4279 | * <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] | 4280 | * <p><b>Limited capability</b> - |
| 4281 | * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the |
| 4282 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 4283 | * |
| 4284 | * @see CaptureRequest#EDGE_MODE |
Zhijun He | 513f7c3 | 2015-04-24 18:23:54 -0700 | [diff] [blame] | 4285 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Zhijun He | 0e99c22 | 2015-01-29 15:26:05 -0800 | [diff] [blame] | 4286 | * @see CaptureRequest#NOISE_REDUCTION_MODE |
| 4287 | * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES |
| 4288 | */ |
| 4289 | @PublicKey |
| 4290 | public static final Key<Float> REPROCESS_EFFECTIVE_EXPOSURE_FACTOR = |
| 4291 | new Key<Float>("android.reprocess.effectiveExposureFactor", float.class); |
| 4292 | |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 4293 | /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ |
| 4294 | * End generated code |
| 4295 | *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 4296 | |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 4297 | |
| 4298 | |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 4299 | } |