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