Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2013 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 | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 19 | import android.hardware.camera2.impl.CameraMetadataNative; |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 20 | import android.hardware.camera2.impl.PublicKey; |
| 21 | import android.hardware.camera2.impl.SyntheticKey; |
Ruben Brunk | 5776aaf | 2014-06-19 13:42:40 -0700 | [diff] [blame] | 22 | import android.hardware.camera2.utils.HashCodeHelpers; |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame] | 23 | import android.hardware.camera2.utils.TypeReference; |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 24 | import android.os.Parcel; |
| 25 | import android.os.Parcelable; |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 26 | import android.view.Surface; |
| 27 | |
Ruben Brunk | feb50af | 2014-05-09 19:58:49 -0700 | [diff] [blame] | 28 | import java.util.Collection; |
| 29 | import java.util.Collections; |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 30 | import java.util.HashSet; |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame] | 31 | import java.util.List; |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 32 | import java.util.Objects; |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 33 | |
| 34 | |
| 35 | /** |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 36 | * <p>An immutable package of settings and outputs needed to capture a single |
| 37 | * image from the camera device.</p> |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 38 | * |
| 39 | * <p>Contains the configuration for the capture hardware (sensor, lens, flash), |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 40 | * the processing pipeline, the control algorithms, and the output buffers. Also |
| 41 | * contains the list of target Surfaces to send image data to for this |
| 42 | * capture.</p> |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 43 | * |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 44 | * <p>CaptureRequests can be created by using a {@link Builder} instance, |
| 45 | * obtained by calling {@link CameraDevice#createCaptureRequest}</p> |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 46 | * |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 47 | * <p>CaptureRequests are given to {@link CameraCaptureSession#capture} or |
| 48 | * {@link CameraCaptureSession#setRepeatingRequest} to capture images from a camera.</p> |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 49 | * |
| 50 | * <p>Each request can specify a different subset of target Surfaces for the |
| 51 | * camera to send the captured data to. All the surfaces used in a request must |
| 52 | * be part of the surface list given to the last call to |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 53 | * {@link CameraDevice#createCaptureSession}, when the request is submitted to the |
| 54 | * session.</p> |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 55 | * |
| 56 | * <p>For example, a request meant for repeating preview might only include the |
| 57 | * Surface for the preview SurfaceView or SurfaceTexture, while a |
| 58 | * high-resolution still capture would also include a Surface from a ImageReader |
| 59 | * configured for high-resolution JPEG images.</p> |
| 60 | * |
| 61 | * @see CameraDevice#capture |
| 62 | * @see CameraDevice#setRepeatingRequest |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 63 | * @see CameraDevice#createCaptureRequest |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 64 | */ |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame] | 65 | public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> |
| 66 | implements Parcelable { |
| 67 | |
| 68 | /** |
| 69 | * A {@code Key} is used to do capture request field lookups with |
| 70 | * {@link CaptureResult#get} or to set fields with |
| 71 | * {@link CaptureRequest.Builder#set(Key, Object)}. |
| 72 | * |
| 73 | * <p>For example, to set the crop rectangle for the next capture: |
| 74 | * <code><pre> |
| 75 | * Rect cropRectangle = new Rect(0, 0, 640, 480); |
| 76 | * captureRequestBuilder.set(SCALER_CROP_REGION, cropRectangle); |
| 77 | * </pre></code> |
| 78 | * </p> |
| 79 | * |
| 80 | * <p>To enumerate over all possible keys for {@link CaptureResult}, see |
| 81 | * {@link CameraCharacteristics#getAvailableCaptureResultKeys}.</p> |
| 82 | * |
| 83 | * @see CaptureResult#get |
| 84 | * @see CameraCharacteristics#getAvailableCaptureResultKeys |
| 85 | */ |
| 86 | public final static class Key<T> { |
| 87 | private final CameraMetadataNative.Key<T> mKey; |
| 88 | |
| 89 | /** |
| 90 | * Visible for testing and vendor extensions only. |
| 91 | * |
| 92 | * @hide |
| 93 | */ |
| 94 | public Key(String name, Class<T> type) { |
| 95 | mKey = new CameraMetadataNative.Key<T>(name, type); |
| 96 | } |
| 97 | |
| 98 | /** |
| 99 | * Visible for testing and vendor extensions only. |
| 100 | * |
| 101 | * @hide |
| 102 | */ |
| 103 | public Key(String name, TypeReference<T> typeReference) { |
| 104 | mKey = new CameraMetadataNative.Key<T>(name, typeReference); |
| 105 | } |
| 106 | |
| 107 | /** |
| 108 | * Return a camelCase, period separated name formatted like: |
| 109 | * {@code "root.section[.subsections].name"}. |
| 110 | * |
| 111 | * <p>Built-in keys exposed by the Android SDK are always prefixed with {@code "android."}; |
| 112 | * keys that are device/platform-specific are prefixed with {@code "com."}.</p> |
| 113 | * |
| 114 | * <p>For example, {@code CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP} would |
| 115 | * have a name of {@code "android.scaler.streamConfigurationMap"}; whereas a device |
| 116 | * specific key might look like {@code "com.google.nexus.data.private"}.</p> |
| 117 | * |
| 118 | * @return String representation of the key name |
| 119 | */ |
| 120 | public String getName() { |
| 121 | return mKey.getName(); |
| 122 | } |
| 123 | |
| 124 | /** |
| 125 | * {@inheritDoc} |
| 126 | */ |
| 127 | @Override |
| 128 | public final int hashCode() { |
| 129 | return mKey.hashCode(); |
| 130 | } |
| 131 | |
| 132 | /** |
| 133 | * {@inheritDoc} |
| 134 | */ |
| 135 | @SuppressWarnings("unchecked") |
| 136 | @Override |
| 137 | public final boolean equals(Object o) { |
| 138 | return o instanceof Key && ((Key<T>)o).mKey.equals(mKey); |
| 139 | } |
| 140 | |
| 141 | /** |
| 142 | * Visible for CameraMetadataNative implementation only; do not use. |
| 143 | * |
| 144 | * TODO: Make this private or remove it altogether. |
| 145 | * |
| 146 | * @hide |
| 147 | */ |
| 148 | public CameraMetadataNative.Key<T> getNativeKey() { |
| 149 | return mKey; |
| 150 | } |
| 151 | |
| 152 | @SuppressWarnings({ "unchecked" }) |
| 153 | /*package*/ Key(CameraMetadataNative.Key<?> nativeKey) { |
| 154 | mKey = (CameraMetadataNative.Key<T>) nativeKey; |
| 155 | } |
| 156 | } |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 157 | |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 158 | private final HashSet<Surface> mSurfaceSet; |
| 159 | private final CameraMetadataNative mSettings; |
| 160 | |
Eino-Ville Talvala | 4068388 | 2013-08-08 16:56:28 -0700 | [diff] [blame] | 161 | private Object mUserTag; |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 162 | |
| 163 | /** |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 164 | * Construct empty request. |
| 165 | * |
| 166 | * Used by Binder to unparcel this object only. |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 167 | */ |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 168 | private CaptureRequest() { |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 169 | mSettings = new CameraMetadataNative(); |
| 170 | mSurfaceSet = new HashSet<Surface>(); |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 171 | } |
| 172 | |
| 173 | /** |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 174 | * Clone from source capture request. |
| 175 | * |
| 176 | * Used by the Builder to create an immutable copy. |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 177 | */ |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 178 | @SuppressWarnings("unchecked") |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 179 | private CaptureRequest(CaptureRequest source) { |
| 180 | mSettings = new CameraMetadataNative(source.mSettings); |
| 181 | mSurfaceSet = (HashSet<Surface>) source.mSurfaceSet.clone(); |
Eino-Ville Talvala | 7b01c5c | 2013-10-08 19:34:29 -0700 | [diff] [blame] | 182 | mUserTag = source.mUserTag; |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 183 | } |
| 184 | |
| 185 | /** |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 186 | * Take ownership of passed-in settings. |
| 187 | * |
| 188 | * Used by the Builder to create a mutable CaptureRequest. |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 189 | */ |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 190 | private CaptureRequest(CameraMetadataNative settings) { |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame] | 191 | mSettings = CameraMetadataNative.move(settings); |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 192 | mSurfaceSet = new HashSet<Surface>(); |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 193 | } |
| 194 | |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame] | 195 | /** |
| 196 | * Get a capture request field value. |
| 197 | * |
| 198 | * <p>The field definitions can be found in {@link CaptureRequest}.</p> |
| 199 | * |
| 200 | * <p>Querying the value for the same key more than once will return a value |
| 201 | * which is equal to the previous queried value.</p> |
| 202 | * |
| 203 | * @throws IllegalArgumentException if the key was not valid |
| 204 | * |
| 205 | * @param key The result field to read. |
| 206 | * @return The value of that key, or {@code null} if the field is not set. |
| 207 | */ |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 208 | public <T> T get(Key<T> key) { |
| 209 | return mSettings.get(key); |
Eino-Ville Talvala | 4068388 | 2013-08-08 16:56:28 -0700 | [diff] [blame] | 210 | } |
| 211 | |
| 212 | /** |
Igor Murashkin | d6d6515 | 2014-05-19 16:31:02 -0700 | [diff] [blame] | 213 | * {@inheritDoc} |
| 214 | * @hide |
| 215 | */ |
| 216 | @SuppressWarnings("unchecked") |
| 217 | @Override |
| 218 | protected <T> T getProtected(Key<?> key) { |
| 219 | return (T) mSettings.get(key); |
| 220 | } |
| 221 | |
| 222 | /** |
| 223 | * {@inheritDoc} |
| 224 | * @hide |
| 225 | */ |
| 226 | @SuppressWarnings("unchecked") |
| 227 | @Override |
| 228 | protected Class<Key<?>> getKeyClass() { |
| 229 | Object thisClass = Key.class; |
| 230 | return (Class<Key<?>>)thisClass; |
| 231 | } |
| 232 | |
| 233 | /** |
| 234 | * {@inheritDoc} |
| 235 | */ |
| 236 | @Override |
| 237 | public List<Key<?>> getKeys() { |
| 238 | // Force the javadoc for this function to show up on the CaptureRequest page |
| 239 | return super.getKeys(); |
| 240 | } |
| 241 | |
| 242 | /** |
Eino-Ville Talvala | 4068388 | 2013-08-08 16:56:28 -0700 | [diff] [blame] | 243 | * Retrieve the tag for this request, if any. |
| 244 | * |
| 245 | * <p>This tag is not used for anything by the camera device, but can be |
| 246 | * used by an application to easily identify a CaptureRequest when it is |
| 247 | * returned by |
Eino-Ville Talvala | fd88743 | 2014-09-04 13:07:40 -0700 | [diff] [blame] | 248 | * {@link CameraCaptureSession.CaptureCallback#onCaptureCompleted CaptureCallback.onCaptureCompleted} |
Eino-Ville Talvala | 4068388 | 2013-08-08 16:56:28 -0700 | [diff] [blame] | 249 | * </p> |
| 250 | * |
| 251 | * @return the last tag Object set on this request, or {@code null} if |
| 252 | * no tag has been set. |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 253 | * @see Builder#setTag |
Eino-Ville Talvala | 4068388 | 2013-08-08 16:56:28 -0700 | [diff] [blame] | 254 | */ |
| 255 | public Object getTag() { |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 256 | return mUserTag; |
Eino-Ville Talvala | 4068388 | 2013-08-08 16:56:28 -0700 | [diff] [blame] | 257 | } |
| 258 | |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 259 | /** |
| 260 | * Determine whether this CaptureRequest is equal to another CaptureRequest. |
| 261 | * |
| 262 | * <p>A request is considered equal to another is if it's set of key/values is equal, it's |
| 263 | * list of output surfaces is equal, and the user tag is equal.</p> |
| 264 | * |
| 265 | * @param other Another instance of CaptureRequest. |
| 266 | * |
| 267 | * @return True if the requests are the same, false otherwise. |
| 268 | */ |
| 269 | @Override |
| 270 | public boolean equals(Object other) { |
| 271 | return other instanceof CaptureRequest |
| 272 | && equals((CaptureRequest)other); |
| 273 | } |
| 274 | |
| 275 | private boolean equals(CaptureRequest other) { |
| 276 | return other != null |
| 277 | && Objects.equals(mUserTag, other.mUserTag) |
| 278 | && mSurfaceSet.equals(other.mSurfaceSet) |
| 279 | && mSettings.equals(other.mSettings); |
| 280 | } |
| 281 | |
| 282 | @Override |
| 283 | public int hashCode() { |
Ruben Brunk | 5776aaf | 2014-06-19 13:42:40 -0700 | [diff] [blame] | 284 | return HashCodeHelpers.hashCode(mSettings, mSurfaceSet, mUserTag); |
Igor Murashkin | 6bbf9dc | 2013-09-05 12:22:00 -0700 | [diff] [blame] | 285 | } |
| 286 | |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 287 | public static final Parcelable.Creator<CaptureRequest> CREATOR = |
| 288 | new Parcelable.Creator<CaptureRequest>() { |
| 289 | @Override |
| 290 | public CaptureRequest createFromParcel(Parcel in) { |
| 291 | CaptureRequest request = new CaptureRequest(); |
| 292 | request.readFromParcel(in); |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 293 | |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 294 | return request; |
| 295 | } |
| 296 | |
| 297 | @Override |
| 298 | public CaptureRequest[] newArray(int size) { |
| 299 | return new CaptureRequest[size]; |
| 300 | } |
| 301 | }; |
| 302 | |
| 303 | /** |
| 304 | * Expand this object from a Parcel. |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 305 | * Hidden since this breaks the immutability of CaptureRequest, but is |
| 306 | * needed to receive CaptureRequests with aidl. |
| 307 | * |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 308 | * @param in The parcel from which the object should be read |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 309 | * @hide |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 310 | */ |
Igor Murashkin | 72f9f0a | 2014-05-14 15:46:10 -0700 | [diff] [blame] | 311 | private void readFromParcel(Parcel in) { |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 312 | mSettings.readFromParcel(in); |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 313 | |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 314 | mSurfaceSet.clear(); |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 315 | |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 316 | Parcelable[] parcelableArray = in.readParcelableArray(Surface.class.getClassLoader()); |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 317 | |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 318 | if (parcelableArray == null) { |
| 319 | return; |
| 320 | } |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 321 | |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 322 | for (Parcelable p : parcelableArray) { |
| 323 | Surface s = (Surface) p; |
| 324 | mSurfaceSet.add(s); |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 325 | } |
| 326 | } |
| 327 | |
| 328 | @Override |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 329 | public int describeContents() { |
| 330 | return 0; |
| 331 | } |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 332 | |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 333 | @Override |
| 334 | public void writeToParcel(Parcel dest, int flags) { |
| 335 | mSettings.writeToParcel(dest, flags); |
| 336 | dest.writeParcelableArray(mSurfaceSet.toArray(new Surface[mSurfaceSet.size()]), flags); |
| 337 | } |
| 338 | |
| 339 | /** |
Ruben Brunk | feb50af | 2014-05-09 19:58:49 -0700 | [diff] [blame] | 340 | * @hide |
| 341 | */ |
| 342 | public boolean containsTarget(Surface surface) { |
| 343 | return mSurfaceSet.contains(surface); |
| 344 | } |
| 345 | |
| 346 | /** |
| 347 | * @hide |
| 348 | */ |
| 349 | public Collection<Surface> getTargets() { |
| 350 | return Collections.unmodifiableCollection(mSurfaceSet); |
| 351 | } |
| 352 | |
| 353 | /** |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 354 | * A builder for capture requests. |
| 355 | * |
| 356 | * <p>To obtain a builder instance, use the |
| 357 | * {@link CameraDevice#createCaptureRequest} method, which initializes the |
| 358 | * request fields to one of the templates defined in {@link CameraDevice}. |
| 359 | * |
| 360 | * @see CameraDevice#createCaptureRequest |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 361 | * @see CameraDevice#TEMPLATE_PREVIEW |
| 362 | * @see CameraDevice#TEMPLATE_RECORD |
| 363 | * @see CameraDevice#TEMPLATE_STILL_CAPTURE |
| 364 | * @see CameraDevice#TEMPLATE_VIDEO_SNAPSHOT |
| 365 | * @see CameraDevice#TEMPLATE_MANUAL |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 366 | */ |
| 367 | public final static class Builder { |
| 368 | |
Igor Murashkin | 7a36a0f | 2013-09-10 18:13:09 -0700 | [diff] [blame] | 369 | private final CaptureRequest mRequest; |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 370 | |
| 371 | /** |
| 372 | * Initialize the builder using the template; the request takes |
| 373 | * ownership of the template. |
| 374 | * |
| 375 | * @hide |
| 376 | */ |
| 377 | public Builder(CameraMetadataNative template) { |
| 378 | mRequest = new CaptureRequest(template); |
Igor Murashkin | 7072550 | 2013-06-25 20:27:06 +0000 | [diff] [blame] | 379 | } |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 380 | |
| 381 | /** |
| 382 | * <p>Add a surface to the list of targets for this request</p> |
| 383 | * |
| 384 | * <p>The Surface added must be one of the surfaces included in the most |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 385 | * recent call to {@link CameraDevice#createCaptureSession}, when the |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 386 | * request is given to the camera device.</p> |
| 387 | * |
| 388 | * <p>Adding a target more than once has no effect.</p> |
| 389 | * |
| 390 | * @param outputTarget Surface to use as an output target for this request |
| 391 | */ |
| 392 | public void addTarget(Surface outputTarget) { |
| 393 | mRequest.mSurfaceSet.add(outputTarget); |
| 394 | } |
| 395 | |
| 396 | /** |
| 397 | * <p>Remove a surface from the list of targets for this request.</p> |
| 398 | * |
| 399 | * <p>Removing a target that is not currently added has no effect.</p> |
| 400 | * |
| 401 | * @param outputTarget Surface to use as an output target for this request |
| 402 | */ |
| 403 | public void removeTarget(Surface outputTarget) { |
| 404 | mRequest.mSurfaceSet.remove(outputTarget); |
| 405 | } |
| 406 | |
| 407 | /** |
| 408 | * Set a capture request field to a value. The field definitions can be |
| 409 | * found in {@link CaptureRequest}. |
| 410 | * |
| 411 | * @param key The metadata field to write. |
| 412 | * @param value The value to set the field to, which must be of a matching |
| 413 | * type to the key. |
| 414 | */ |
| 415 | public <T> void set(Key<T> key, T value) { |
| 416 | mRequest.mSettings.set(key, value); |
| 417 | } |
| 418 | |
| 419 | /** |
| 420 | * Get a capture request field value. The field definitions can be |
| 421 | * found in {@link CaptureRequest}. |
| 422 | * |
| 423 | * @throws IllegalArgumentException if the key was not valid |
| 424 | * |
| 425 | * @param key The metadata field to read. |
| 426 | * @return The value of that key, or {@code null} if the field is not set. |
| 427 | */ |
| 428 | public <T> T get(Key<T> key) { |
| 429 | return mRequest.mSettings.get(key); |
| 430 | } |
| 431 | |
| 432 | /** |
| 433 | * Set a tag for this request. |
| 434 | * |
| 435 | * <p>This tag is not used for anything by the camera device, but can be |
| 436 | * used by an application to easily identify a CaptureRequest when it is |
| 437 | * returned by |
Eino-Ville Talvala | fd88743 | 2014-09-04 13:07:40 -0700 | [diff] [blame] | 438 | * {@link CameraCaptureSession.CaptureCallback#onCaptureCompleted CaptureCallback.onCaptureCompleted} |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 439 | * |
| 440 | * @param tag an arbitrary Object to store with this request |
| 441 | * @see CaptureRequest#getTag |
| 442 | */ |
| 443 | public void setTag(Object tag) { |
| 444 | mRequest.mUserTag = tag; |
| 445 | } |
| 446 | |
| 447 | /** |
| 448 | * Build a request using the current target Surfaces and settings. |
Sol Boucher | edeab40 | 2014-07-09 18:36:28 -0700 | [diff] [blame] | 449 | * <p>Note that, although it is possible to create a {@code CaptureRequest} with no target |
| 450 | * {@link Surface}s, passing such a request into {@link CameraCaptureSession#capture}, |
| 451 | * {@link CameraCaptureSession#captureBurst}, |
| 452 | * {@link CameraCaptureSession#setRepeatingBurst}, or |
| 453 | * {@link CameraCaptureSession#setRepeatingRequest} will cause that method to throw an |
| 454 | * {@link IllegalArgumentException}.</p> |
Eino-Ville Talvala | 70c2207 | 2013-08-27 12:09:04 -0700 | [diff] [blame] | 455 | * |
| 456 | * @return A new capture request instance, ready for submission to the |
| 457 | * camera device. |
| 458 | */ |
| 459 | public CaptureRequest build() { |
| 460 | return new CaptureRequest(mRequest); |
| 461 | } |
| 462 | |
| 463 | |
| 464 | /** |
| 465 | * @hide |
| 466 | */ |
| 467 | public boolean isEmpty() { |
| 468 | return mRequest.mSettings.isEmpty(); |
| 469 | } |
| 470 | |
Eino-Ville Talvala | b267554 | 2012-12-12 13:29:45 -0800 | [diff] [blame] | 471 | } |
| 472 | |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 473 | /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ |
| 474 | * The key entries below this point are generated from metadata |
| 475 | * definitions in /system/media/camera/docs. Do not modify by hand or |
| 476 | * modify the comment blocks at the start or end. |
| 477 | *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/ |
| 478 | |
| 479 | /** |
Igor Murashkin | 7d2a5c5 | 2014-01-17 15:07:52 -0800 | [diff] [blame] | 480 | * <p>The mode control selects how the image data is converted from the |
| 481 | * sensor's native color into linear sRGB color.</p> |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 482 | * <p>When auto-white balance (AWB) is enabled with {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, this |
Igor Murashkin | 7d2a5c5 | 2014-01-17 15:07:52 -0800 | [diff] [blame] | 483 | * control is overridden by the AWB routine. When AWB is disabled, the |
| 484 | * application controls how the color mapping is performed.</p> |
| 485 | * <p>We define the expected processing pipeline below. For consistency |
| 486 | * across devices, this is always the case with TRANSFORM_MATRIX.</p> |
| 487 | * <p>When either FULL or HIGH_QUALITY is used, the camera device may |
| 488 | * do additional processing but {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and |
| 489 | * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} will still be provided by the |
| 490 | * camera device (in the results) and be roughly correct.</p> |
| 491 | * <p>Switching to TRANSFORM_MATRIX and using the data provided from |
| 492 | * FAST or HIGH_QUALITY will yield a picture with the same white point |
| 493 | * as what was produced by the camera device in the earlier frame.</p> |
| 494 | * <p>The expected processing pipeline is as follows:</p> |
| 495 | * <p><img alt="White balance processing pipeline" src="../../../../images/camera2/metadata/android.colorCorrection.mode/processing_pipeline.png" /></p> |
| 496 | * <p>The white balance is encoded by two values, a 4-channel white-balance |
| 497 | * gain vector (applied in the Bayer domain), and a 3x3 color transform |
| 498 | * matrix (applied after demosaic).</p> |
| 499 | * <p>The 4-channel white-balance gains are defined as:</p> |
| 500 | * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} = [ R G_even G_odd B ] |
| 501 | * </code></pre> |
| 502 | * <p>where <code>G_even</code> is the gain for green pixels on even rows of the |
| 503 | * output, and <code>G_odd</code> is the gain for green pixels on the odd rows. |
| 504 | * These may be identical for a given camera device implementation; if |
| 505 | * the camera device does not support a separate gain for even/odd green |
| 506 | * channels, it will use the <code>G_even</code> value, and write <code>G_odd</code> equal to |
| 507 | * <code>G_even</code> in the output result metadata.</p> |
| 508 | * <p>The matrices for color transforms are defined as a 9-entry vector:</p> |
| 509 | * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} = [ I0 I1 I2 I3 I4 I5 I6 I7 I8 ] |
| 510 | * </code></pre> |
| 511 | * <p>which define a transform from input sensor colors, <code>P_in = [ r g b ]</code>, |
| 512 | * to output linear sRGB, <code>P_out = [ r' g' b' ]</code>,</p> |
| 513 | * <p>with colors as follows:</p> |
| 514 | * <pre><code>r' = I0r + I1g + I2b |
| 515 | * g' = I3r + I4g + I5b |
| 516 | * b' = I6r + I7g + I8b |
| 517 | * </code></pre> |
| 518 | * <p>Both the input and output value ranges must match. Overflow/underflow |
| 519 | * values are clipped to fit within the range.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 520 | * <p><b>Possible values:</b> |
| 521 | * <ul> |
| 522 | * <li>{@link #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX TRANSFORM_MATRIX}</li> |
| 523 | * <li>{@link #COLOR_CORRECTION_MODE_FAST FAST}</li> |
| 524 | * <li>{@link #COLOR_CORRECTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li> |
| 525 | * </ul></p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 526 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 527 | * <p><b>Full capability</b> - |
| 528 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 529 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 530 | * |
Igor Murashkin | 7d2a5c5 | 2014-01-17 15:07:52 -0800 | [diff] [blame] | 531 | * @see CaptureRequest#COLOR_CORRECTION_GAINS |
| 532 | * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 533 | * @see CaptureRequest#CONTROL_AWB_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 534 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 535 | * @see #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX |
| 536 | * @see #COLOR_CORRECTION_MODE_FAST |
| 537 | * @see #COLOR_CORRECTION_MODE_HIGH_QUALITY |
| 538 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 539 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 540 | public static final Key<Integer> COLOR_CORRECTION_MODE = |
| 541 | new Key<Integer>("android.colorCorrection.mode", int.class); |
| 542 | |
| 543 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 544 | * <p>A color transform matrix to use to transform |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 545 | * from sensor RGB color space to output linear sRGB color space.</p> |
Zhijun He | 49a3ca9 | 2014-02-05 13:48:09 -0800 | [diff] [blame] | 546 | * <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] | 547 | * {@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] | 548 | * directly by the application in the request when the |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 549 | * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p> |
Zhijun He | 49a3ca9 | 2014-02-05 13:48:09 -0800 | [diff] [blame] | 550 | * <p>In the latter case, the camera device may round the matrix to account |
| 551 | * for precision issues; the final rounded matrix should be reported back |
| 552 | * in this matrix result metadata. The transform should keep the magnitude |
| 553 | * of the output color values within <code>[0, 1.0]</code> (assuming input color |
| 554 | * values is within the normalized range <code>[0, 1.0]</code>), or clipping may occur.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 555 | * <p><b>Units</b>: Unitless scale factors</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 556 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 557 | * <p><b>Full capability</b> - |
| 558 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 559 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 560 | * |
| 561 | * @see CaptureRequest#COLOR_CORRECTION_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 562 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 563 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 564 | @PublicKey |
Eino-Ville Talvala | 2bb91a7 | 2014-05-27 18:16:53 -0700 | [diff] [blame] | 565 | public static final Key<android.hardware.camera2.params.ColorSpaceTransform> COLOR_CORRECTION_TRANSFORM = |
| 566 | 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] | 567 | |
| 568 | /** |
Igor Murashkin | 7d2a5c5 | 2014-01-17 15:07:52 -0800 | [diff] [blame] | 569 | * <p>Gains applying to Bayer raw color channels for |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 570 | * white-balance.</p> |
Eino-Ville Talvala | 2bb91a7 | 2014-05-27 18:16:53 -0700 | [diff] [blame] | 571 | * <p>These per-channel gains are either set by the camera device |
| 572 | * when the request {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not |
| 573 | * TRANSFORM_MATRIX, or directly by the application in the |
| 574 | * request when the {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is |
| 575 | * TRANSFORM_MATRIX.</p> |
| 576 | * <p>The gains in the result metadata are the gains actually |
| 577 | * applied by the camera device to the current frame.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 578 | * <p><b>Units</b>: Unitless gain factors</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 579 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 580 | * <p><b>Full capability</b> - |
| 581 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 582 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 583 | * |
| 584 | * @see CaptureRequest#COLOR_CORRECTION_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 585 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 586 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 587 | @PublicKey |
Eino-Ville Talvala | 2bb91a7 | 2014-05-27 18:16:53 -0700 | [diff] [blame] | 588 | public static final Key<android.hardware.camera2.params.RggbChannelVector> COLOR_CORRECTION_GAINS = |
| 589 | 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] | 590 | |
| 591 | /** |
Zhijun He | a05e59d | 2014-07-08 18:27:47 -0700 | [diff] [blame] | 592 | * <p>Mode of operation for the chromatic aberration correction algorithm.</p> |
Zhijun He | a05e59d | 2014-07-08 18:27:47 -0700 | [diff] [blame] | 593 | * <p>Chromatic (color) aberration is caused by the fact that different wavelengths of light |
| 594 | * can not focus on the same point after exiting from the lens. This metadata defines |
| 595 | * the high level control of chromatic aberration correction algorithm, which aims to |
| 596 | * minimize the chromatic artifacts that may occur along the object boundaries in an |
| 597 | * image.</p> |
| 598 | * <p>FAST/HIGH_QUALITY both mean that camera device determined aberration |
| 599 | * correction will be applied. HIGH_QUALITY mode indicates that the camera device will |
| 600 | * use the highest-quality aberration correction algorithms, even if it slows down |
| 601 | * capture rate. FAST means the camera device will not slow down capture rate when |
| 602 | * applying aberration correction.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 603 | * <p>LEGACY devices will always be in FAST mode.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 604 | * <p><b>Possible values:</b> |
| 605 | * <ul> |
| 606 | * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_OFF OFF}</li> |
| 607 | * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_FAST FAST}</li> |
| 608 | * <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY HIGH_QUALITY}</li> |
| 609 | * </ul></p> |
| 610 | * <p><b>Available values for this device:</b><br> |
| 611 | * {@link CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES android.colorCorrection.availableAberrationModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 612 | * <p>This key is available on all devices.</p> |
Zhijun He | a05e59d | 2014-07-08 18:27:47 -0700 | [diff] [blame] | 613 | * |
Zhijun He | 9e4e439 | 2014-08-18 11:12:32 -0700 | [diff] [blame] | 614 | * @see CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES |
| 615 | * @see #COLOR_CORRECTION_ABERRATION_MODE_OFF |
| 616 | * @see #COLOR_CORRECTION_ABERRATION_MODE_FAST |
| 617 | * @see #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY |
Zhijun He | a05e59d | 2014-07-08 18:27:47 -0700 | [diff] [blame] | 618 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 619 | @PublicKey |
Zhijun He | 9e4e439 | 2014-08-18 11:12:32 -0700 | [diff] [blame] | 620 | public static final Key<Integer> COLOR_CORRECTION_ABERRATION_MODE = |
| 621 | new Key<Integer>("android.colorCorrection.aberrationMode", int.class); |
Zhijun He | a05e59d | 2014-07-08 18:27:47 -0700 | [diff] [blame] | 622 | |
| 623 | /** |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 624 | * <p>The desired setting for the camera device's auto-exposure |
| 625 | * algorithm's antibanding compensation.</p> |
| 626 | * <p>Some kinds of lighting fixtures, such as some fluorescent |
| 627 | * lights, flicker at the rate of the power supply frequency |
| 628 | * (60Hz or 50Hz, depending on country). While this is |
| 629 | * typically not noticeable to a person, it can be visible to |
| 630 | * a camera device. If a camera sets its exposure time to the |
| 631 | * wrong value, the flicker may become visible in the |
| 632 | * viewfinder as flicker or in a final captured image, as a |
| 633 | * set of variable-brightness bands across the image.</p> |
| 634 | * <p>Therefore, the auto-exposure routines of camera devices |
| 635 | * include antibanding routines that ensure that the chosen |
| 636 | * exposure value will not cause such banding. The choice of |
| 637 | * exposure time depends on the rate of flicker, which the |
| 638 | * camera device can detect automatically, or the expected |
| 639 | * rate can be selected by the application using this |
| 640 | * control.</p> |
| 641 | * <p>A given camera device may not support all of the possible |
| 642 | * options for the antibanding mode. The |
| 643 | * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes} key contains |
| 644 | * the available modes for a given camera device.</p> |
Yin-Chia Yeh | 7b2cae6 | 2014-11-25 11:54:18 -0800 | [diff] [blame] | 645 | * <p>AUTO mode is the default if it is available on given |
| 646 | * camera device. When AUTO mode is not available, the |
| 647 | * default will be either 50HZ or 60HZ, and both 50HZ |
| 648 | * and 60HZ will be available.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 649 | * <p>If manual exposure control is enabled (by setting |
| 650 | * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} to OFF), |
| 651 | * then this setting has no effect, and the application must |
| 652 | * ensure it selects exposure times that do not cause banding |
| 653 | * issues. The {@link CaptureResult#STATISTICS_SCENE_FLICKER android.statistics.sceneFlicker} key can assist |
| 654 | * the application in this.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 655 | * <p><b>Possible values:</b> |
| 656 | * <ul> |
| 657 | * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_OFF OFF}</li> |
| 658 | * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_50HZ 50HZ}</li> |
| 659 | * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_60HZ 60HZ}</li> |
| 660 | * <li>{@link #CONTROL_AE_ANTIBANDING_MODE_AUTO AUTO}</li> |
| 661 | * </ul></p> |
| 662 | * <p><b>Available values for this device:</b><br></p> |
| 663 | * <p>{@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 664 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 665 | * |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 666 | * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES |
Zhijun He | 399f05d | 2014-01-15 11:31:30 -0800 | [diff] [blame] | 667 | * @see CaptureRequest#CONTROL_AE_MODE |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 668 | * @see CaptureRequest#CONTROL_MODE |
| 669 | * @see CaptureResult#STATISTICS_SCENE_FLICKER |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 670 | * @see #CONTROL_AE_ANTIBANDING_MODE_OFF |
| 671 | * @see #CONTROL_AE_ANTIBANDING_MODE_50HZ |
| 672 | * @see #CONTROL_AE_ANTIBANDING_MODE_60HZ |
| 673 | * @see #CONTROL_AE_ANTIBANDING_MODE_AUTO |
| 674 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 675 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 676 | public static final Key<Integer> CONTROL_AE_ANTIBANDING_MODE = |
| 677 | new Key<Integer>("android.control.aeAntibandingMode", int.class); |
| 678 | |
| 679 | /** |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 680 | * <p>Adjustment to auto-exposure (AE) target image |
| 681 | * brightness.</p> |
| 682 | * <p>The adjustment is measured as a count of steps, with the |
| 683 | * step size defined by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep} and the |
| 684 | * allowed range by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}.</p> |
| 685 | * <p>For example, if the exposure value (EV) step is 0.333, '6' |
| 686 | * will mean an exposure compensation of +2 EV; -3 will mean an |
| 687 | * exposure compensation of -1 EV. One EV represents a doubling |
| 688 | * of image brightness. Note that this control will only be |
| 689 | * effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF. This control |
| 690 | * 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] | 691 | * <p>In the event of exposure compensation value being changed, camera device |
| 692 | * may take several frames to reach the newly requested exposure target. |
| 693 | * During that time, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} field will be in the SEARCHING |
| 694 | * state. Once the new exposure target is reached, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} will |
| 695 | * change from SEARCHING to either CONVERGED, LOCKED (if AE lock is enabled), or |
| 696 | * 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] | 697 | * <p><b>Units</b>: Compensation steps</p> |
| 698 | * <p><b>Range of valid values:</b><br> |
| 699 | * {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 700 | * <p>This key is available on all devices.</p> |
Yin-Chia Yeh | a4227df | 2014-05-05 14:27:39 -0700 | [diff] [blame] | 701 | * |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 702 | * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE |
| 703 | * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP |
Yin-Chia Yeh | a4227df | 2014-05-05 14:27:39 -0700 | [diff] [blame] | 704 | * @see CaptureRequest#CONTROL_AE_LOCK |
| 705 | * @see CaptureRequest#CONTROL_AE_MODE |
| 706 | * @see CaptureResult#CONTROL_AE_STATE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 707 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 708 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 709 | public static final Key<Integer> CONTROL_AE_EXPOSURE_COMPENSATION = |
| 710 | new Key<Integer>("android.control.aeExposureCompensation", int.class); |
| 711 | |
| 712 | /** |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 713 | * <p>Whether auto-exposure (AE) is currently locked to its latest |
Zhijun He | 49a3ca9 | 2014-02-05 13:48:09 -0800 | [diff] [blame] | 714 | * calculated values.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 715 | * <p>When set to <code>true</code> (ON), the AE algorithm is locked to its latest parameters, |
| 716 | * and will not change exposure settings until the lock is set to <code>false</code> (OFF).</p> |
| 717 | * <p>Note that even when AE is locked, the flash may be fired if |
| 718 | * the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_AUTO_FLASH / |
| 719 | * ON_ALWAYS_FLASH / ON_AUTO_FLASH_REDEYE.</p> |
Yin-Chia Yeh | a4227df | 2014-05-05 14:27:39 -0700 | [diff] [blame] | 720 | * <p>When {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation} is changed, even if the AE lock |
| 721 | * is ON, the camera device will still adjust its exposure value.</p> |
Zhijun He | 49a3ca9 | 2014-02-05 13:48:09 -0800 | [diff] [blame] | 722 | * <p>If AE precapture is triggered (see {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}) |
| 723 | * when AE is already locked, the camera device will not change the exposure time |
| 724 | * ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}) and sensitivity ({@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}) |
Eino-Ville Talvala | d8fd679 | 2014-02-10 12:41:04 -0800 | [diff] [blame] | 725 | * parameters. The flash may be fired if the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} |
Zhijun He | 49a3ca9 | 2014-02-05 13:48:09 -0800 | [diff] [blame] | 726 | * is ON_AUTO_FLASH/ON_AUTO_FLASH_REDEYE and the scene is too dark. If the |
| 727 | * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_ALWAYS_FLASH, the scene may become overexposed.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 728 | * <p>Since the camera device has a pipeline of in-flight requests, the settings that |
| 729 | * get locked do not necessarily correspond to the settings that were present in the |
| 730 | * latest capture result received from the camera device, since additional captures |
| 731 | * and AE updates may have occurred even before the result was sent out. If an |
| 732 | * application is switching between automatic and manual control and wishes to eliminate |
| 733 | * any flicker during the switch, the following procedure is recommended:</p> |
| 734 | * <ol> |
| 735 | * <li>Starting in auto-AE mode:</li> |
| 736 | * <li>Lock AE</li> |
| 737 | * <li>Wait for the first result to be output that has the AE locked</li> |
| 738 | * <li>Copy exposure settings from that result into a request, set the request to manual AE</li> |
| 739 | * <li>Submit the capture request, proceed to run manual AE as desired.</li> |
| 740 | * </ol> |
Zhijun He | 49a3ca9 | 2014-02-05 13:48:09 -0800 | [diff] [blame] | 741 | * <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] | 742 | * <p>This key is available on all devices.</p> |
Zhijun He | 49a3ca9 | 2014-02-05 13:48:09 -0800 | [diff] [blame] | 743 | * |
Yin-Chia Yeh | a4227df | 2014-05-05 14:27:39 -0700 | [diff] [blame] | 744 | * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION |
Zhijun He | 49a3ca9 | 2014-02-05 13:48:09 -0800 | [diff] [blame] | 745 | * @see CaptureRequest#CONTROL_AE_MODE |
| 746 | * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER |
| 747 | * @see CaptureResult#CONTROL_AE_STATE |
| 748 | * @see CaptureRequest#SENSOR_EXPOSURE_TIME |
| 749 | * @see CaptureRequest#SENSOR_SENSITIVITY |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 750 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 751 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 752 | public static final Key<Boolean> CONTROL_AE_LOCK = |
| 753 | new Key<Boolean>("android.control.aeLock", boolean.class); |
| 754 | |
| 755 | /** |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 756 | * <p>The desired mode for the camera device's |
| 757 | * auto-exposure routine.</p> |
| 758 | * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is |
| 759 | * AUTO.</p> |
| 760 | * <p>When set to any of the ON modes, the camera device's |
| 761 | * auto-exposure routine is enabled, overriding the |
| 762 | * application's selected exposure time, sensor sensitivity, |
| 763 | * and frame duration ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}, |
| 764 | * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and |
| 765 | * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}). If one of the FLASH modes |
| 766 | * is selected, the camera device's flash unit controls are |
| 767 | * also overridden.</p> |
| 768 | * <p>The FLASH modes are only available if the camera device |
| 769 | * has a flash unit ({@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} is <code>true</code>).</p> |
| 770 | * <p>If flash TORCH mode is desired, this field must be set to |
| 771 | * ON or OFF, and {@link CaptureRequest#FLASH_MODE android.flash.mode} set to TORCH.</p> |
| 772 | * <p>When set to any of the ON modes, the values chosen by the |
| 773 | * camera device auto-exposure routine for the overridden |
| 774 | * fields for a given capture will be available in its |
| 775 | * CaptureResult.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 776 | * <p><b>Possible values:</b> |
| 777 | * <ul> |
| 778 | * <li>{@link #CONTROL_AE_MODE_OFF OFF}</li> |
| 779 | * <li>{@link #CONTROL_AE_MODE_ON ON}</li> |
| 780 | * <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH ON_AUTO_FLASH}</li> |
| 781 | * <li>{@link #CONTROL_AE_MODE_ON_ALWAYS_FLASH ON_ALWAYS_FLASH}</li> |
| 782 | * <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE ON_AUTO_FLASH_REDEYE}</li> |
| 783 | * </ul></p> |
| 784 | * <p><b>Available values for this device:</b><br> |
| 785 | * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES android.control.aeAvailableModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 786 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 787 | * |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 788 | * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 789 | * @see CaptureRequest#CONTROL_MODE |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 790 | * @see CameraCharacteristics#FLASH_INFO_AVAILABLE |
| 791 | * @see CaptureRequest#FLASH_MODE |
Igor Murashkin | aef3b7e | 2014-01-15 13:20:37 -0800 | [diff] [blame] | 792 | * @see CaptureRequest#SENSOR_EXPOSURE_TIME |
| 793 | * @see CaptureRequest#SENSOR_FRAME_DURATION |
Zhijun He | 399f05d | 2014-01-15 11:31:30 -0800 | [diff] [blame] | 794 | * @see CaptureRequest#SENSOR_SENSITIVITY |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 795 | * @see #CONTROL_AE_MODE_OFF |
| 796 | * @see #CONTROL_AE_MODE_ON |
| 797 | * @see #CONTROL_AE_MODE_ON_AUTO_FLASH |
| 798 | * @see #CONTROL_AE_MODE_ON_ALWAYS_FLASH |
| 799 | * @see #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE |
| 800 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 801 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 802 | public static final Key<Integer> CONTROL_AE_MODE = |
| 803 | new Key<Integer>("android.control.aeMode", int.class); |
| 804 | |
| 805 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 806 | * <p>List of metering areas to use for auto-exposure adjustment.</p> |
| 807 | * <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] | 808 | * Otherwise will always be present.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 809 | * <p>The maximum number of regions supported by the device is determined by the value |
| 810 | * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe}.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 811 | * <p>The coordinate system is based on the active pixel array, |
Timothy Knight | 2629f27 | 2013-09-03 17:23:23 -0700 | [diff] [blame] | 812 | * 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] | 813 | * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1, |
| 814 | * {@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] | 815 | * bottom-right pixel in the active pixel array.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 816 | * <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] | 817 | * for every pixel in the area. This means that a large metering area |
| 818 | * with the same weight as a smaller area will have more effect in |
| 819 | * the metering result. Metering areas can partially overlap and the |
| 820 | * camera device will add the weights in the overlap region.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 821 | * <p>The weights are relative to weights of other exposure metering regions, so if only one |
| 822 | * region is used, all non-zero weights will have the same effect. A region with 0 |
| 823 | * weight is ignored.</p> |
| 824 | * <p>If all regions have 0 weight, then no specific metering area needs to be used by the |
| 825 | * camera device.</p> |
| 826 | * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in |
| 827 | * capture result metadata, the camera device will ignore the sections outside the crop |
| 828 | * region and output only the intersection rectangle as the metering region in the result |
| 829 | * metadata. If the region is entirely outside the crop region, it will be ignored and |
| 830 | * not reported in the result metadata.</p> |
| 831 | * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p> |
| 832 | * <p><b>Range of valid values:</b><br> |
| 833 | * Coordinates must be between <code>[(0,0), (width, height))</code> of |
| 834 | * {@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] | 835 | * <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] | 836 | * |
Yin-Chia Yeh | 808150f | 2014-09-08 15:48:47 -0700 | [diff] [blame] | 837 | * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AE |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 838 | * @see CaptureRequest#SCALER_CROP_REGION |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 839 | * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 840 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 841 | @PublicKey |
Yin-Chia Yeh | 817f893 | 2014-05-19 10:23:27 -0700 | [diff] [blame] | 842 | public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AE_REGIONS = |
| 843 | 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] | 844 | |
| 845 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 846 | * <p>Range over which the auto-exposure routine can |
| 847 | * adjust the capture frame rate to maintain good |
| 848 | * exposure.</p> |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 849 | * <p>Only constrains auto-exposure (AE) algorithm, not |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 850 | * manual control of {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime} and |
| 851 | * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}.</p> |
| 852 | * <p><b>Units</b>: Frames per second (FPS)</p> |
| 853 | * <p><b>Range of valid values:</b><br> |
| 854 | * Any of the entries in {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES android.control.aeAvailableTargetFpsRanges}</p> |
| 855 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 856 | * |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 857 | * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 858 | * @see CaptureRequest#SENSOR_EXPOSURE_TIME |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 859 | * @see CaptureRequest#SENSOR_FRAME_DURATION |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 860 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 861 | @PublicKey |
Igor Murashkin | 78712a8 | 2014-05-27 18:32:18 -0700 | [diff] [blame] | 862 | public static final Key<android.util.Range<Integer>> CONTROL_AE_TARGET_FPS_RANGE = |
| 863 | new Key<android.util.Range<Integer>>("android.control.aeTargetFpsRange", new TypeReference<android.util.Range<Integer>>() {{ }}); |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 864 | |
| 865 | /** |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 866 | * <p>Whether the camera device will trigger a precapture |
| 867 | * metering sequence when it processes this request.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 868 | * <p>This entry is normally set to IDLE, or is not |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 869 | * included at all in the request settings. When included and |
Zhijun He | dd72be5 | 2015-02-06 13:49:51 -0800 | [diff] [blame] | 870 | * set to START, the camera device will trigger the auto-exposure (AE) |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 871 | * precapture metering sequence.</p> |
Zhijun He | dd72be5 | 2015-02-06 13:49:51 -0800 | [diff] [blame] | 872 | * <p>The precapture sequence should be triggered before starting a |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 873 | * high-quality still capture for final metering decisions to |
| 874 | * be made, and for firing pre-capture flash pulses to estimate |
| 875 | * scene brightness and required final capture flash power, when |
| 876 | * the flash is enabled.</p> |
| 877 | * <p>Normally, this entry should be set to START for only a |
| 878 | * single request, and the application should wait until the |
| 879 | * sequence completes before starting a new one.</p> |
Zhijun He | dd72be5 | 2015-02-06 13:49:51 -0800 | [diff] [blame] | 880 | * <p>When a precapture metering sequence is finished, the camera device |
| 881 | * may lock the auto-exposure routine internally to be able to accurately expose the |
| 882 | * subsequent still capture image (<code>{@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} == STILL_CAPTURE</code>). |
| 883 | * For this case, the AE may not resume normal scan if no subsequent still capture is |
| 884 | * submitted. To ensure that the AE routine restarts normal scan, the application should |
| 885 | * submit a request with <code>{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} == true</code>, followed by a request |
| 886 | * with <code>{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} == false</code>, if the application decides not to submit a |
| 887 | * still capture request after the precapture sequence completes.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 888 | * <p>The exact effect of auto-exposure (AE) precapture trigger |
| 889 | * depends on the current AE mode and state; see |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 890 | * {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE precapture state transition |
| 891 | * details.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 892 | * <p>On LEGACY-level devices, the precapture trigger is not supported; |
| 893 | * capturing a high-resolution JPEG image will automatically trigger a |
| 894 | * precapture sequence before the high-resolution capture, including |
| 895 | * potentially firing a pre-capture flash.</p> |
| 896 | * <p><b>Possible values:</b> |
| 897 | * <ul> |
| 898 | * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE IDLE}</li> |
| 899 | * <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_START START}</li> |
| 900 | * </ul></p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 901 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 902 | * <p><b>Limited capability</b> - |
| 903 | * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the |
| 904 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 905 | * |
Zhijun He | dd72be5 | 2015-02-06 13:49:51 -0800 | [diff] [blame] | 906 | * @see CaptureRequest#CONTROL_AE_LOCK |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 907 | * @see CaptureResult#CONTROL_AE_STATE |
Zhijun He | dd72be5 | 2015-02-06 13:49:51 -0800 | [diff] [blame] | 908 | * @see CaptureRequest#CONTROL_CAPTURE_INTENT |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 909 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 910 | * @see #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE |
| 911 | * @see #CONTROL_AE_PRECAPTURE_TRIGGER_START |
| 912 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 913 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 914 | public static final Key<Integer> CONTROL_AE_PRECAPTURE_TRIGGER = |
| 915 | new Key<Integer>("android.control.aePrecaptureTrigger", int.class); |
| 916 | |
| 917 | /** |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 918 | * <p>Whether auto-focus (AF) is currently enabled, and what |
| 919 | * mode it is set to.</p> |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 920 | * <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] | 921 | * (i.e. <code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} > 0</code>). Also note that |
| 922 | * when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF, the behavior of AF is device |
| 923 | * dependent. It is recommended to lock AF by using {@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger} before |
| 924 | * 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] | 925 | * <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] | 926 | * 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] | 927 | * in result metadata.</p> |
| 928 | * <p><b>Possible values:</b> |
| 929 | * <ul> |
| 930 | * <li>{@link #CONTROL_AF_MODE_OFF OFF}</li> |
| 931 | * <li>{@link #CONTROL_AF_MODE_AUTO AUTO}</li> |
| 932 | * <li>{@link #CONTROL_AF_MODE_MACRO MACRO}</li> |
| 933 | * <li>{@link #CONTROL_AF_MODE_CONTINUOUS_VIDEO CONTINUOUS_VIDEO}</li> |
| 934 | * <li>{@link #CONTROL_AF_MODE_CONTINUOUS_PICTURE CONTINUOUS_PICTURE}</li> |
| 935 | * <li>{@link #CONTROL_AF_MODE_EDOF EDOF}</li> |
| 936 | * </ul></p> |
| 937 | * <p><b>Available values for this device:</b><br> |
| 938 | * {@link CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES android.control.afAvailableModes}</p> |
| 939 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 940 | * |
Yin-Chia Yeh | 7144b5d | 2014-11-12 11:42:49 -0800 | [diff] [blame] | 941 | * @see CaptureRequest#CONTROL_AE_MODE |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 942 | * @see CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES |
Eino-Ville Talvala | d8fd679 | 2014-02-10 12:41:04 -0800 | [diff] [blame] | 943 | * @see CaptureResult#CONTROL_AF_STATE |
Yin-Chia Yeh | 7144b5d | 2014-11-12 11:42:49 -0800 | [diff] [blame] | 944 | * @see CaptureRequest#CONTROL_AF_TRIGGER |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 945 | * @see CaptureRequest#CONTROL_MODE |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 946 | * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 947 | * @see #CONTROL_AF_MODE_OFF |
| 948 | * @see #CONTROL_AF_MODE_AUTO |
| 949 | * @see #CONTROL_AF_MODE_MACRO |
| 950 | * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO |
| 951 | * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE |
| 952 | * @see #CONTROL_AF_MODE_EDOF |
| 953 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 954 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 955 | public static final Key<Integer> CONTROL_AF_MODE = |
| 956 | new Key<Integer>("android.control.afMode", int.class); |
| 957 | |
| 958 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 959 | * <p>List of metering areas to use for auto-focus.</p> |
| 960 | * <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] | 961 | * Otherwise will always be present.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 962 | * <p>The maximum number of focus areas supported by the device is determined by the value |
| 963 | * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf}.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 964 | * <p>The coordinate system is based on the active pixel array, |
Timothy Knight | 2629f27 | 2013-09-03 17:23:23 -0700 | [diff] [blame] | 965 | * 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] | 966 | * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1, |
| 967 | * {@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] | 968 | * bottom-right pixel in the active pixel array.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 969 | * <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] | 970 | * for every pixel in the area. This means that a large metering area |
| 971 | * with the same weight as a smaller area will have more effect in |
| 972 | * the metering result. Metering areas can partially overlap and the |
| 973 | * camera device will add the weights in the overlap region.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 974 | * <p>The weights are relative to weights of other metering regions, so if only one region |
| 975 | * is used, all non-zero weights will have the same effect. A region with 0 weight is |
| 976 | * ignored.</p> |
| 977 | * <p>If all regions have 0 weight, then no specific metering area needs to be used by the |
| 978 | * camera device.</p> |
| 979 | * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in |
| 980 | * capture result metadata, the camera device will ignore the sections outside the crop |
| 981 | * region and output only the intersection rectangle as the metering region in the result |
| 982 | * metadata. If the region is entirely outside the crop region, it will be ignored and |
| 983 | * not reported in the result metadata.</p> |
| 984 | * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p> |
| 985 | * <p><b>Range of valid values:</b><br> |
| 986 | * Coordinates must be between <code>[(0,0), (width, height))</code> of |
| 987 | * {@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] | 988 | * <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] | 989 | * |
Yin-Chia Yeh | 808150f | 2014-09-08 15:48:47 -0700 | [diff] [blame] | 990 | * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AF |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 991 | * @see CaptureRequest#SCALER_CROP_REGION |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 992 | * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 993 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 994 | @PublicKey |
Yin-Chia Yeh | 817f893 | 2014-05-19 10:23:27 -0700 | [diff] [blame] | 995 | public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AF_REGIONS = |
| 996 | 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] | 997 | |
| 998 | /** |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 999 | * <p>Whether the camera device will trigger autofocus for this request.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1000 | * <p>This entry is normally set to IDLE, or is not |
| 1001 | * included at all in the request settings.</p> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 1002 | * <p>When included and set to START, the camera device will trigger the |
| 1003 | * autofocus algorithm. If autofocus is disabled, this trigger has no effect.</p> |
| 1004 | * <p>When set to CANCEL, the camera device will cancel any active trigger, |
| 1005 | * and return to its initial AF state.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1006 | * <p>Generally, applications should set this entry to START or CANCEL for only a |
| 1007 | * single capture, and then return it to IDLE (or not set at all). Specifying |
| 1008 | * START for multiple captures in a row means restarting the AF operation over |
| 1009 | * and over again.</p> |
| 1010 | * <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] | 1011 | * <p><b>Possible values:</b> |
| 1012 | * <ul> |
| 1013 | * <li>{@link #CONTROL_AF_TRIGGER_IDLE IDLE}</li> |
| 1014 | * <li>{@link #CONTROL_AF_TRIGGER_START START}</li> |
| 1015 | * <li>{@link #CONTROL_AF_TRIGGER_CANCEL CANCEL}</li> |
| 1016 | * </ul></p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1017 | * <p>This key is available on all devices.</p> |
Zhijun He | 228f4f9 | 2014-01-16 17:22:05 -0800 | [diff] [blame] | 1018 | * |
| 1019 | * @see CaptureResult#CONTROL_AF_STATE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1020 | * @see #CONTROL_AF_TRIGGER_IDLE |
| 1021 | * @see #CONTROL_AF_TRIGGER_START |
| 1022 | * @see #CONTROL_AF_TRIGGER_CANCEL |
| 1023 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1024 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1025 | public static final Key<Integer> CONTROL_AF_TRIGGER = |
| 1026 | new Key<Integer>("android.control.afTrigger", int.class); |
| 1027 | |
| 1028 | /** |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 1029 | * <p>Whether auto-white balance (AWB) is currently locked to its |
Zhijun He | 2d5e897 | 2014-02-07 16:13:46 -0800 | [diff] [blame] | 1030 | * latest calculated values.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1031 | * <p>When set to <code>true</code> (ON), the AWB algorithm is locked to its latest parameters, |
| 1032 | * and will not change color balance settings until the lock is set to <code>false</code> (OFF).</p> |
| 1033 | * <p>Since the camera device has a pipeline of in-flight requests, the settings that |
| 1034 | * get locked do not necessarily correspond to the settings that were present in the |
| 1035 | * latest capture result received from the camera device, since additional captures |
| 1036 | * and AWB updates may have occurred even before the result was sent out. If an |
| 1037 | * application is switching between automatic and manual control and wishes to eliminate |
| 1038 | * any flicker during the switch, the following procedure is recommended:</p> |
| 1039 | * <ol> |
| 1040 | * <li>Starting in auto-AWB mode:</li> |
| 1041 | * <li>Lock AWB</li> |
| 1042 | * <li>Wait for the first result to be output that has the AWB locked</li> |
| 1043 | * <li>Copy AWB settings from that result into a request, set the request to manual AWB</li> |
| 1044 | * <li>Submit the capture request, proceed to run manual AWB as desired.</li> |
| 1045 | * </ol> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1046 | * <p>Note that AWB lock is only meaningful when |
| 1047 | * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is in the AUTO mode; in other modes, |
| 1048 | * AWB is already fixed to a specific setting.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1049 | * <p>Some LEGACY devices may not support ON; the value is then overridden to OFF.</p> |
| 1050 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1051 | * |
| 1052 | * @see CaptureRequest#CONTROL_AWB_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1053 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1054 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1055 | public static final Key<Boolean> CONTROL_AWB_LOCK = |
| 1056 | new Key<Boolean>("android.control.awbLock", boolean.class); |
| 1057 | |
| 1058 | /** |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 1059 | * <p>Whether auto-white balance (AWB) is currently setting the color |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1060 | * transform fields, and what its illumination target |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 1061 | * is.</p> |
Zhijun He | 399f05d | 2014-01-15 11:31:30 -0800 | [diff] [blame] | 1062 | * <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] | 1063 | * <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] | 1064 | * routine is enabled, overriding the application's selected |
| 1065 | * {@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] | 1066 | * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}. Note that when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} |
| 1067 | * is OFF, the behavior of AWB is device dependent. It is recommened to |
| 1068 | * also set AWB mode to OFF or lock AWB by using {@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} before |
| 1069 | * setting AE mode to OFF.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1070 | * <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] | 1071 | * routine is disabled. The application manually controls the white |
Eino-Ville Talvala | d8fd679 | 2014-02-10 12:41:04 -0800 | [diff] [blame] | 1072 | * 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] | 1073 | * and {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1074 | * <p>When set to any other modes, the camera device's auto-white |
| 1075 | * balance routine is disabled. The camera device uses each |
| 1076 | * particular illumination target for white balance |
| 1077 | * adjustment. The application's values for |
| 1078 | * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, |
| 1079 | * {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and |
| 1080 | * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} are ignored.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1081 | * <p><b>Possible values:</b> |
| 1082 | * <ul> |
| 1083 | * <li>{@link #CONTROL_AWB_MODE_OFF OFF}</li> |
| 1084 | * <li>{@link #CONTROL_AWB_MODE_AUTO AUTO}</li> |
| 1085 | * <li>{@link #CONTROL_AWB_MODE_INCANDESCENT INCANDESCENT}</li> |
| 1086 | * <li>{@link #CONTROL_AWB_MODE_FLUORESCENT FLUORESCENT}</li> |
| 1087 | * <li>{@link #CONTROL_AWB_MODE_WARM_FLUORESCENT WARM_FLUORESCENT}</li> |
| 1088 | * <li>{@link #CONTROL_AWB_MODE_DAYLIGHT DAYLIGHT}</li> |
| 1089 | * <li>{@link #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT CLOUDY_DAYLIGHT}</li> |
| 1090 | * <li>{@link #CONTROL_AWB_MODE_TWILIGHT TWILIGHT}</li> |
| 1091 | * <li>{@link #CONTROL_AWB_MODE_SHADE SHADE}</li> |
| 1092 | * </ul></p> |
| 1093 | * <p><b>Available values for this device:</b><br> |
| 1094 | * {@link CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES android.control.awbAvailableModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1095 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1096 | * |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 1097 | * @see CaptureRequest#COLOR_CORRECTION_GAINS |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 1098 | * @see CaptureRequest#COLOR_CORRECTION_MODE |
| 1099 | * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM |
Yin-Chia Yeh | 7144b5d | 2014-11-12 11:42:49 -0800 | [diff] [blame] | 1100 | * @see CaptureRequest#CONTROL_AE_MODE |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1101 | * @see CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES |
Yin-Chia Yeh | 7144b5d | 2014-11-12 11:42:49 -0800 | [diff] [blame] | 1102 | * @see CaptureRequest#CONTROL_AWB_LOCK |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 1103 | * @see CaptureRequest#CONTROL_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1104 | * @see #CONTROL_AWB_MODE_OFF |
| 1105 | * @see #CONTROL_AWB_MODE_AUTO |
| 1106 | * @see #CONTROL_AWB_MODE_INCANDESCENT |
| 1107 | * @see #CONTROL_AWB_MODE_FLUORESCENT |
| 1108 | * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT |
| 1109 | * @see #CONTROL_AWB_MODE_DAYLIGHT |
| 1110 | * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT |
| 1111 | * @see #CONTROL_AWB_MODE_TWILIGHT |
| 1112 | * @see #CONTROL_AWB_MODE_SHADE |
| 1113 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1114 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1115 | public static final Key<Integer> CONTROL_AWB_MODE = |
| 1116 | new Key<Integer>("android.control.awbMode", int.class); |
| 1117 | |
| 1118 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1119 | * <p>List of metering areas to use for auto-white-balance illuminant |
Ruben Brunk | f59521d | 2014-02-03 17:14:33 -0800 | [diff] [blame] | 1120 | * estimation.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1121 | * <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] | 1122 | * Otherwise will always be present.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1123 | * <p>The maximum number of regions supported by the device is determined by the value |
| 1124 | * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb}.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1125 | * <p>The coordinate system is based on the active pixel array, |
Timothy Knight | 2629f27 | 2013-09-03 17:23:23 -0700 | [diff] [blame] | 1126 | * 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] | 1127 | * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1, |
| 1128 | * {@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] | 1129 | * bottom-right pixel in the active pixel array.</p> |
| 1130 | * <p>The weight must range from 0 to 1000, and represents a weight |
| 1131 | * for every pixel in the area. This means that a large metering area |
| 1132 | * with the same weight as a smaller area will have more effect in |
| 1133 | * the metering result. Metering areas can partially overlap and the |
| 1134 | * camera device will add the weights in the overlap region.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1135 | * <p>The weights are relative to weights of other white balance metering regions, so if |
| 1136 | * only one region is used, all non-zero weights will have the same effect. A region with |
| 1137 | * 0 weight is ignored.</p> |
| 1138 | * <p>If all regions have 0 weight, then no specific metering area needs to be used by the |
| 1139 | * camera device.</p> |
| 1140 | * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in |
| 1141 | * capture result metadata, the camera device will ignore the sections outside the crop |
| 1142 | * region and output only the intersection rectangle as the metering region in the result |
| 1143 | * metadata. If the region is entirely outside the crop region, it will be ignored and |
| 1144 | * not reported in the result metadata.</p> |
| 1145 | * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p> |
| 1146 | * <p><b>Range of valid values:</b><br> |
| 1147 | * Coordinates must be between <code>[(0,0), (width, height))</code> of |
| 1148 | * {@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] | 1149 | * <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] | 1150 | * |
Yin-Chia Yeh | 808150f | 2014-09-08 15:48:47 -0700 | [diff] [blame] | 1151 | * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AWB |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1152 | * @see CaptureRequest#SCALER_CROP_REGION |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 1153 | * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1154 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1155 | @PublicKey |
Yin-Chia Yeh | 817f893 | 2014-05-19 10:23:27 -0700 | [diff] [blame] | 1156 | public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS = |
| 1157 | 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] | 1158 | |
| 1159 | /** |
Zhijun He | 66d065a | 2014-01-16 18:18:50 -0800 | [diff] [blame] | 1160 | * <p>Information to the camera device 3A (auto-exposure, |
| 1161 | * auto-focus, auto-white balance) routines about the purpose |
| 1162 | * of this capture, to help the camera device to decide optimal 3A |
| 1163 | * strategy.</p> |
Zhijun He | e30adb7 | 2014-04-09 19:04:31 -0700 | [diff] [blame] | 1164 | * <p>This control (except for MANUAL) is only effective if |
| 1165 | * <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] | 1166 | * <p>ZERO_SHUTTER_LAG will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} |
| 1167 | * contains ZSL. MANUAL will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1168 | * contains MANUAL_SENSOR. Other intent values are always supported.</p> |
| 1169 | * <p><b>Possible values:</b> |
| 1170 | * <ul> |
| 1171 | * <li>{@link #CONTROL_CAPTURE_INTENT_CUSTOM CUSTOM}</li> |
| 1172 | * <li>{@link #CONTROL_CAPTURE_INTENT_PREVIEW PREVIEW}</li> |
| 1173 | * <li>{@link #CONTROL_CAPTURE_INTENT_STILL_CAPTURE STILL_CAPTURE}</li> |
| 1174 | * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_RECORD VIDEO_RECORD}</li> |
| 1175 | * <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT VIDEO_SNAPSHOT}</li> |
| 1176 | * <li>{@link #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li> |
| 1177 | * <li>{@link #CONTROL_CAPTURE_INTENT_MANUAL MANUAL}</li> |
| 1178 | * </ul></p> |
| 1179 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1180 | * |
| 1181 | * @see CaptureRequest#CONTROL_MODE |
Zhijun He | e30adb7 | 2014-04-09 19:04:31 -0700 | [diff] [blame] | 1182 | * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1183 | * @see #CONTROL_CAPTURE_INTENT_CUSTOM |
| 1184 | * @see #CONTROL_CAPTURE_INTENT_PREVIEW |
| 1185 | * @see #CONTROL_CAPTURE_INTENT_STILL_CAPTURE |
| 1186 | * @see #CONTROL_CAPTURE_INTENT_VIDEO_RECORD |
| 1187 | * @see #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT |
| 1188 | * @see #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG |
Zhijun He | e30adb7 | 2014-04-09 19:04:31 -0700 | [diff] [blame] | 1189 | * @see #CONTROL_CAPTURE_INTENT_MANUAL |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1190 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1191 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1192 | public static final Key<Integer> CONTROL_CAPTURE_INTENT = |
| 1193 | new Key<Integer>("android.control.captureIntent", int.class); |
| 1194 | |
| 1195 | /** |
Ruben Brunk | 5f1dcfe | 2014-01-17 16:42:51 -0800 | [diff] [blame] | 1196 | * <p>A special color effect to apply.</p> |
| 1197 | * <p>When this mode is set, a color effect will be applied |
| 1198 | * to images produced by the camera device. The interpretation |
| 1199 | * and implementation of these color effects is left to the |
| 1200 | * implementor of the camera device, and should not be |
| 1201 | * depended on to be consistent (or present) across all |
| 1202 | * devices.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1203 | * <p><b>Possible values:</b> |
| 1204 | * <ul> |
| 1205 | * <li>{@link #CONTROL_EFFECT_MODE_OFF OFF}</li> |
| 1206 | * <li>{@link #CONTROL_EFFECT_MODE_MONO MONO}</li> |
| 1207 | * <li>{@link #CONTROL_EFFECT_MODE_NEGATIVE NEGATIVE}</li> |
| 1208 | * <li>{@link #CONTROL_EFFECT_MODE_SOLARIZE SOLARIZE}</li> |
| 1209 | * <li>{@link #CONTROL_EFFECT_MODE_SEPIA SEPIA}</li> |
| 1210 | * <li>{@link #CONTROL_EFFECT_MODE_POSTERIZE POSTERIZE}</li> |
| 1211 | * <li>{@link #CONTROL_EFFECT_MODE_WHITEBOARD WHITEBOARD}</li> |
| 1212 | * <li>{@link #CONTROL_EFFECT_MODE_BLACKBOARD BLACKBOARD}</li> |
| 1213 | * <li>{@link #CONTROL_EFFECT_MODE_AQUA AQUA}</li> |
| 1214 | * </ul></p> |
| 1215 | * <p><b>Available values for this device:</b><br> |
| 1216 | * {@link CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS android.control.availableEffects}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1217 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1218 | * |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1219 | * @see CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1220 | * @see #CONTROL_EFFECT_MODE_OFF |
| 1221 | * @see #CONTROL_EFFECT_MODE_MONO |
| 1222 | * @see #CONTROL_EFFECT_MODE_NEGATIVE |
| 1223 | * @see #CONTROL_EFFECT_MODE_SOLARIZE |
| 1224 | * @see #CONTROL_EFFECT_MODE_SEPIA |
| 1225 | * @see #CONTROL_EFFECT_MODE_POSTERIZE |
| 1226 | * @see #CONTROL_EFFECT_MODE_WHITEBOARD |
| 1227 | * @see #CONTROL_EFFECT_MODE_BLACKBOARD |
| 1228 | * @see #CONTROL_EFFECT_MODE_AQUA |
| 1229 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1230 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1231 | public static final Key<Integer> CONTROL_EFFECT_MODE = |
| 1232 | new Key<Integer>("android.control.effectMode", int.class); |
| 1233 | |
| 1234 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1235 | * <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] | 1236 | * routines.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1237 | * <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] | 1238 | * 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] | 1239 | * capture parameters itself.</p> |
| 1240 | * <p>When set to AUTO, the individual algorithm controls in |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1241 | * 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] | 1242 | * <p>When set to USE_SCENE_MODE, the individual controls in |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 1243 | * android.control.* are mostly disabled, and the camera device implements |
Zhijun He | f353742 | 2013-12-16 16:56:35 -0800 | [diff] [blame] | 1244 | * one of the scene mode settings (such as ACTION, SUNSET, or PARTY) |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 1245 | * as it wishes. The camera device scene mode 3A settings are provided by |
Zhijun He | f353742 | 2013-12-16 16:56:35 -0800 | [diff] [blame] | 1246 | * android.control.sceneModeOverrides.</p> |
Zhijun He | 2d5e897 | 2014-02-07 16:13:46 -0800 | [diff] [blame] | 1247 | * <p>When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference |
| 1248 | * is that this frame will not be used by camera device background 3A statistics |
| 1249 | * update, as if this frame is never captured. This mode can be used in the scenario |
| 1250 | * where the application doesn't want a 3A manual control capture to affect |
| 1251 | * the subsequent auto 3A capture results.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1252 | * <p>LEGACY mode devices will only support AUTO and USE_SCENE_MODE modes. |
| 1253 | * LIMITED mode devices will only support OFF and OFF_KEEP_STATE if they |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1254 | * support the MANUAL_SENSOR and MANUAL_POST_PROCSESING capabilities. |
| 1255 | * FULL mode devices will always support OFF and OFF_KEEP_STATE.</p> |
| 1256 | * <p><b>Possible values:</b> |
| 1257 | * <ul> |
| 1258 | * <li>{@link #CONTROL_MODE_OFF OFF}</li> |
| 1259 | * <li>{@link #CONTROL_MODE_AUTO AUTO}</li> |
| 1260 | * <li>{@link #CONTROL_MODE_USE_SCENE_MODE USE_SCENE_MODE}</li> |
| 1261 | * <li>{@link #CONTROL_MODE_OFF_KEEP_STATE OFF_KEEP_STATE}</li> |
| 1262 | * </ul></p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1263 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1264 | * |
| 1265 | * @see CaptureRequest#CONTROL_AF_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1266 | * @see #CONTROL_MODE_OFF |
| 1267 | * @see #CONTROL_MODE_AUTO |
| 1268 | * @see #CONTROL_MODE_USE_SCENE_MODE |
Zhijun He | 2d5e897 | 2014-02-07 16:13:46 -0800 | [diff] [blame] | 1269 | * @see #CONTROL_MODE_OFF_KEEP_STATE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1270 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1271 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1272 | public static final Key<Integer> CONTROL_MODE = |
| 1273 | new Key<Integer>("android.control.mode", int.class); |
| 1274 | |
| 1275 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1276 | * <p>Control for which scene mode is currently active.</p> |
| 1277 | * <p>Scene modes are custom camera modes optimized for a certain set of conditions and |
| 1278 | * capture settings.</p> |
Ruben Brunk | e667936 | 2014-01-17 17:05:54 -0800 | [diff] [blame] | 1279 | * <p>This is the mode that that is active when |
| 1280 | * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code>. Aside from FACE_PRIORITY, |
| 1281 | * these modes will disable {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}, |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1282 | * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, and {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} while in use.</p> |
Ruben Brunk | e667936 | 2014-01-17 17:05:54 -0800 | [diff] [blame] | 1283 | * <p>The interpretation and implementation of these scene modes is left |
| 1284 | * to the implementor of the camera device. Their behavior will not be |
| 1285 | * consistent across all devices, and any given device may only implement |
| 1286 | * a subset of these modes.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1287 | * <p><b>Possible values:</b> |
| 1288 | * <ul> |
| 1289 | * <li>{@link #CONTROL_SCENE_MODE_DISABLED DISABLED}</li> |
| 1290 | * <li>{@link #CONTROL_SCENE_MODE_FACE_PRIORITY FACE_PRIORITY}</li> |
| 1291 | * <li>{@link #CONTROL_SCENE_MODE_ACTION ACTION}</li> |
| 1292 | * <li>{@link #CONTROL_SCENE_MODE_PORTRAIT PORTRAIT}</li> |
| 1293 | * <li>{@link #CONTROL_SCENE_MODE_LANDSCAPE LANDSCAPE}</li> |
| 1294 | * <li>{@link #CONTROL_SCENE_MODE_NIGHT NIGHT}</li> |
| 1295 | * <li>{@link #CONTROL_SCENE_MODE_NIGHT_PORTRAIT NIGHT_PORTRAIT}</li> |
| 1296 | * <li>{@link #CONTROL_SCENE_MODE_THEATRE THEATRE}</li> |
| 1297 | * <li>{@link #CONTROL_SCENE_MODE_BEACH BEACH}</li> |
| 1298 | * <li>{@link #CONTROL_SCENE_MODE_SNOW SNOW}</li> |
| 1299 | * <li>{@link #CONTROL_SCENE_MODE_SUNSET SUNSET}</li> |
| 1300 | * <li>{@link #CONTROL_SCENE_MODE_STEADYPHOTO STEADYPHOTO}</li> |
| 1301 | * <li>{@link #CONTROL_SCENE_MODE_FIREWORKS FIREWORKS}</li> |
| 1302 | * <li>{@link #CONTROL_SCENE_MODE_SPORTS SPORTS}</li> |
| 1303 | * <li>{@link #CONTROL_SCENE_MODE_PARTY PARTY}</li> |
| 1304 | * <li>{@link #CONTROL_SCENE_MODE_CANDLELIGHT CANDLELIGHT}</li> |
| 1305 | * <li>{@link #CONTROL_SCENE_MODE_BARCODE BARCODE}</li> |
| 1306 | * <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] | 1307 | * <li>{@link #CONTROL_SCENE_MODE_HDR HDR}</li> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1308 | * </ul></p> |
| 1309 | * <p><b>Available values for this device:</b><br> |
| 1310 | * {@link CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES android.control.availableSceneModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1311 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1312 | * |
Ruben Brunk | e667936 | 2014-01-17 17:05:54 -0800 | [diff] [blame] | 1313 | * @see CaptureRequest#CONTROL_AE_MODE |
| 1314 | * @see CaptureRequest#CONTROL_AF_MODE |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1315 | * @see CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES |
Ruben Brunk | e667936 | 2014-01-17 17:05:54 -0800 | [diff] [blame] | 1316 | * @see CaptureRequest#CONTROL_AWB_MODE |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1317 | * @see CaptureRequest#CONTROL_MODE |
Ruben Brunk | e667936 | 2014-01-17 17:05:54 -0800 | [diff] [blame] | 1318 | * @see #CONTROL_SCENE_MODE_DISABLED |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1319 | * @see #CONTROL_SCENE_MODE_FACE_PRIORITY |
| 1320 | * @see #CONTROL_SCENE_MODE_ACTION |
| 1321 | * @see #CONTROL_SCENE_MODE_PORTRAIT |
| 1322 | * @see #CONTROL_SCENE_MODE_LANDSCAPE |
| 1323 | * @see #CONTROL_SCENE_MODE_NIGHT |
| 1324 | * @see #CONTROL_SCENE_MODE_NIGHT_PORTRAIT |
| 1325 | * @see #CONTROL_SCENE_MODE_THEATRE |
| 1326 | * @see #CONTROL_SCENE_MODE_BEACH |
| 1327 | * @see #CONTROL_SCENE_MODE_SNOW |
| 1328 | * @see #CONTROL_SCENE_MODE_SUNSET |
| 1329 | * @see #CONTROL_SCENE_MODE_STEADYPHOTO |
| 1330 | * @see #CONTROL_SCENE_MODE_FIREWORKS |
| 1331 | * @see #CONTROL_SCENE_MODE_SPORTS |
| 1332 | * @see #CONTROL_SCENE_MODE_PARTY |
| 1333 | * @see #CONTROL_SCENE_MODE_CANDLELIGHT |
| 1334 | * @see #CONTROL_SCENE_MODE_BARCODE |
Zhijun He | e040418 | 2014-06-26 13:17:09 -0700 | [diff] [blame] | 1335 | * @see #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO |
Eino-Ville Talvala | f4eac12 | 2014-12-05 11:10:15 -0800 | [diff] [blame] | 1336 | * @see #CONTROL_SCENE_MODE_HDR |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1337 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1338 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1339 | public static final Key<Integer> CONTROL_SCENE_MODE = |
| 1340 | new Key<Integer>("android.control.sceneMode", int.class); |
| 1341 | |
| 1342 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1343 | * <p>Whether video stabilization is |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 1344 | * active.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1345 | * <p>Video stabilization automatically translates and scales images from |
| 1346 | * the camera in order to stabilize motion between consecutive frames.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1347 | * <p>If enabled, video stabilization can modify the |
Zhijun He | 45fa43a1 | 2014-06-13 18:29:37 -0700 | [diff] [blame] | 1348 | * {@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] | 1349 | * <p>Switching between different video stabilization modes may take several |
| 1350 | * frames to initialize, the camera device will report the current mode |
| 1351 | * in capture result metadata. For example, When "ON" mode is requested, |
| 1352 | * the video stabilization modes in the first several capture results may |
| 1353 | * still be "OFF", and it will become "ON" when the initialization is |
| 1354 | * done.</p> |
| 1355 | * <p>If a camera device supports both this mode and OIS |
| 1356 | * ({@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}), turning both modes on may |
| 1357 | * produce undesirable interaction, so it is recommended not to enable |
| 1358 | * both at the same time.</p> |
| 1359 | * <p><b>Possible values:</b> |
| 1360 | * <ul> |
| 1361 | * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_OFF OFF}</li> |
| 1362 | * <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_ON ON}</li> |
| 1363 | * </ul></p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1364 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1365 | * |
Zhijun He | 45fa43a1 | 2014-06-13 18:29:37 -0700 | [diff] [blame] | 1366 | * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 1367 | * @see CaptureRequest#SCALER_CROP_REGION |
Zhijun He | 4793af5 | 2014-05-05 10:39:12 -0700 | [diff] [blame] | 1368 | * @see #CONTROL_VIDEO_STABILIZATION_MODE_OFF |
| 1369 | * @see #CONTROL_VIDEO_STABILIZATION_MODE_ON |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1370 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1371 | @PublicKey |
Zhijun He | 4793af5 | 2014-05-05 10:39:12 -0700 | [diff] [blame] | 1372 | public static final Key<Integer> CONTROL_VIDEO_STABILIZATION_MODE = |
| 1373 | new Key<Integer>("android.control.videoStabilizationMode", int.class); |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1374 | |
| 1375 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1376 | * <p>Operation mode for edge |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 1377 | * enhancement.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1378 | * <p>Edge enhancement improves sharpness and details in the captured image. OFF means |
| 1379 | * no enhancement will be applied by the camera device.</p> |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 1380 | * <p>FAST/HIGH_QUALITY both mean camera device determined enhancement |
Zhijun He | 2807936 | 2013-12-17 10:35:40 -0800 | [diff] [blame] | 1381 | * will be applied. HIGH_QUALITY mode indicates that the |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 1382 | * camera device will use the highest-quality enhancement algorithms, |
| 1383 | * 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] | 1384 | * not slow down capture rate when applying edge enhancement.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1385 | * <p><b>Possible values:</b> |
| 1386 | * <ul> |
| 1387 | * <li>{@link #EDGE_MODE_OFF OFF}</li> |
| 1388 | * <li>{@link #EDGE_MODE_FAST FAST}</li> |
| 1389 | * <li>{@link #EDGE_MODE_HIGH_QUALITY HIGH_QUALITY}</li> |
| 1390 | * </ul></p> |
| 1391 | * <p><b>Available values for this device:</b><br> |
| 1392 | * {@link CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES android.edge.availableEdgeModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1393 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 1394 | * <p><b>Full capability</b> - |
| 1395 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 1396 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Ruben Brunk | 6dc379c | 2014-03-04 15:04:00 -0800 | [diff] [blame] | 1397 | * |
| 1398 | * @see CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1399 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1400 | * @see #EDGE_MODE_OFF |
| 1401 | * @see #EDGE_MODE_FAST |
| 1402 | * @see #EDGE_MODE_HIGH_QUALITY |
| 1403 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1404 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1405 | public static final Key<Integer> EDGE_MODE = |
| 1406 | new Key<Integer>("android.edge.mode", int.class); |
| 1407 | |
| 1408 | /** |
Zhijun He | 66d065a | 2014-01-16 18:18:50 -0800 | [diff] [blame] | 1409 | * <p>The desired mode for for the camera device's flash control.</p> |
| 1410 | * <p>This control is only effective when flash unit is available |
Zhijun He | 153ac10 | 2014-02-03 12:25:12 -0800 | [diff] [blame] | 1411 | * (<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] | 1412 | * <p>When this control is used, the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} must be set to ON or OFF. |
| 1413 | * Otherwise, the camera device auto-exposure related flash control (ON_AUTO_FLASH, |
| 1414 | * ON_ALWAYS_FLASH, or ON_AUTO_FLASH_REDEYE) will override this control.</p> |
| 1415 | * <p>When set to OFF, the camera device will not fire flash for this capture.</p> |
| 1416 | * <p>When set to SINGLE, the camera device will fire flash regardless of the camera |
| 1417 | * 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] | 1418 | * control should be used along with auto-exposure (AE) precapture metering sequence |
Zhijun He | 66d065a | 2014-01-16 18:18:50 -0800 | [diff] [blame] | 1419 | * ({@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}), otherwise, the image may be incorrectly exposed.</p> |
| 1420 | * <p>When set to TORCH, the flash will be on continuously. This mode can be used |
| 1421 | * 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] | 1422 | * <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] | 1423 | * <p><b>Possible values:</b> |
| 1424 | * <ul> |
| 1425 | * <li>{@link #FLASH_MODE_OFF OFF}</li> |
| 1426 | * <li>{@link #FLASH_MODE_SINGLE SINGLE}</li> |
| 1427 | * <li>{@link #FLASH_MODE_TORCH TORCH}</li> |
| 1428 | * </ul></p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1429 | * <p>This key is available on all devices.</p> |
Zhijun He | 66d065a | 2014-01-16 18:18:50 -0800 | [diff] [blame] | 1430 | * |
| 1431 | * @see CaptureRequest#CONTROL_AE_MODE |
| 1432 | * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER |
| 1433 | * @see CameraCharacteristics#FLASH_INFO_AVAILABLE |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 1434 | * @see CaptureResult#FLASH_STATE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1435 | * @see #FLASH_MODE_OFF |
| 1436 | * @see #FLASH_MODE_SINGLE |
| 1437 | * @see #FLASH_MODE_TORCH |
| 1438 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1439 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1440 | public static final Key<Integer> FLASH_MODE = |
| 1441 | new Key<Integer>("android.flash.mode", int.class); |
| 1442 | |
| 1443 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1444 | * <p>Operational mode for hot pixel correction.</p> |
Ruben Brunk | eba1b3a | 2014-02-07 18:23:50 -0800 | [diff] [blame] | 1445 | * <p>Hotpixel correction interpolates out, or otherwise removes, pixels |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1446 | * that do not accurately measure the incoming light (i.e. pixels that |
| 1447 | * are stuck at an arbitrary value or are oversensitive).</p> |
| 1448 | * <p><b>Possible values:</b> |
| 1449 | * <ul> |
| 1450 | * <li>{@link #HOT_PIXEL_MODE_OFF OFF}</li> |
| 1451 | * <li>{@link #HOT_PIXEL_MODE_FAST FAST}</li> |
| 1452 | * <li>{@link #HOT_PIXEL_MODE_HIGH_QUALITY HIGH_QUALITY}</li> |
| 1453 | * </ul></p> |
| 1454 | * <p><b>Available values for this device:</b><br> |
| 1455 | * {@link CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES android.hotPixel.availableHotPixelModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1456 | * <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] | 1457 | * |
| 1458 | * @see CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES |
Ruben Brunk | eba1b3a | 2014-02-07 18:23:50 -0800 | [diff] [blame] | 1459 | * @see #HOT_PIXEL_MODE_OFF |
| 1460 | * @see #HOT_PIXEL_MODE_FAST |
| 1461 | * @see #HOT_PIXEL_MODE_HIGH_QUALITY |
| 1462 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1463 | @PublicKey |
Ruben Brunk | eba1b3a | 2014-02-07 18:23:50 -0800 | [diff] [blame] | 1464 | public static final Key<Integer> HOT_PIXEL_MODE = |
| 1465 | new Key<Integer>("android.hotPixel.mode", int.class); |
| 1466 | |
| 1467 | /** |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 1468 | * <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] | 1469 | * <p>Setting a location object in a request will include the GPS coordinates of the location |
| 1470 | * into any JPEG images captured based on the request. These coordinates can then be |
| 1471 | * viewed by anyone who receives the JPEG image.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1472 | * <p>This key is available on all devices.</p> |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 1473 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1474 | @PublicKey |
| 1475 | @SyntheticKey |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 1476 | public static final Key<android.location.Location> JPEG_GPS_LOCATION = |
| 1477 | new Key<android.location.Location>("android.jpeg.gpsLocation", android.location.Location.class); |
| 1478 | |
| 1479 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1480 | * <p>GPS coordinates to include in output JPEG |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1481 | * EXIF.</p> |
| 1482 | * <p><b>Range of valid values:</b><br> |
| 1483 | * (-180 - 180], [-90,90], [-inf, inf]</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1484 | * <p>This key is available on all devices.</p> |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 1485 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1486 | */ |
| 1487 | public static final Key<double[]> JPEG_GPS_COORDINATES = |
| 1488 | new Key<double[]>("android.jpeg.gpsCoordinates", double[].class); |
| 1489 | |
| 1490 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1491 | * <p>32 characters describing GPS algorithm to |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1492 | * include in EXIF.</p> |
| 1493 | * <p><b>Units</b>: UTF-8 null-terminated string</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1494 | * <p>This key is available on all devices.</p> |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 1495 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1496 | */ |
| 1497 | public static final Key<String> JPEG_GPS_PROCESSING_METHOD = |
| 1498 | new Key<String>("android.jpeg.gpsProcessingMethod", String.class); |
| 1499 | |
| 1500 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1501 | * <p>Time GPS fix was made to include in |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1502 | * EXIF.</p> |
| 1503 | * <p><b>Units</b>: UTC in seconds since January 1, 1970</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1504 | * <p>This key is available on all devices.</p> |
Ruben Brunk | 5749368 | 2014-05-27 18:58:08 -0700 | [diff] [blame] | 1505 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1506 | */ |
| 1507 | public static final Key<Long> JPEG_GPS_TIMESTAMP = |
| 1508 | new Key<Long>("android.jpeg.gpsTimestamp", long.class); |
| 1509 | |
| 1510 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1511 | * <p>The orientation for a JPEG image.</p> |
| 1512 | * <p>The clockwise rotation angle in degrees, relative to the orientation |
| 1513 | * to the camera, that the JPEG picture needs to be rotated by, to be viewed |
| 1514 | * upright.</p> |
| 1515 | * <p>Camera devices may either encode this value into the JPEG EXIF header, or |
| 1516 | * rotate the image data to match this orientation.</p> |
| 1517 | * <p>Note that this orientation is relative to the orientation of the camera sensor, given |
| 1518 | * by {@link CameraCharacteristics#SENSOR_ORIENTATION android.sensor.orientation}.</p> |
| 1519 | * <p>To translate from the device orientation given by the Android sensor APIs, the following |
| 1520 | * sample code may be used:</p> |
| 1521 | * <pre><code>private int getJpegOrientation(CameraCharacteristics c, int deviceOrientation) { |
| 1522 | * if (deviceOrientation == android.view.OrientationEventListener.ORIENTATION_UNKNOWN) return 0; |
| 1523 | * int sensorOrientation = c.get(CameraCharacteristics.SENSOR_ORIENTATION); |
| 1524 | * |
| 1525 | * // Round device orientation to a multiple of 90 |
| 1526 | * deviceOrientation = (deviceOrientation + 45) / 90 * 90; |
| 1527 | * |
| 1528 | * // Reverse device orientation for front-facing cameras |
| 1529 | * boolean facingFront = c.get(CameraCharacteristics.LENS_FACING) == CameraCharacteristics.LENS_FACING_FRONT; |
| 1530 | * if (facingFront) deviceOrientation = -deviceOrientation; |
| 1531 | * |
| 1532 | * // Calculate desired JPEG orientation relative to camera orientation to make |
| 1533 | * // the image upright relative to the device orientation |
| 1534 | * int jpegOrientation = (sensorOrientation + deviceOrientation + 360) % 360; |
| 1535 | * |
| 1536 | * return jpegOrientation; |
| 1537 | * } |
| 1538 | * </code></pre> |
| 1539 | * <p><b>Units</b>: Degrees in multiples of 90</p> |
| 1540 | * <p><b>Range of valid values:</b><br> |
| 1541 | * 0, 90, 180, 270</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1542 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1543 | * |
| 1544 | * @see CameraCharacteristics#SENSOR_ORIENTATION |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1545 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1546 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1547 | public static final Key<Integer> JPEG_ORIENTATION = |
| 1548 | new Key<Integer>("android.jpeg.orientation", int.class); |
| 1549 | |
| 1550 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1551 | * <p>Compression quality of the final JPEG |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 1552 | * image.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1553 | * <p>85-95 is typical usage range.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1554 | * <p><b>Range of valid values:</b><br> |
| 1555 | * 1-100; larger is higher quality</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1556 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1557 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1558 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1559 | public static final Key<Byte> JPEG_QUALITY = |
| 1560 | new Key<Byte>("android.jpeg.quality", byte.class); |
| 1561 | |
| 1562 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1563 | * <p>Compression quality of JPEG |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1564 | * thumbnail.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1565 | * <p><b>Range of valid values:</b><br> |
| 1566 | * 1-100; larger is higher quality</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1567 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1568 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1569 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1570 | public static final Key<Byte> JPEG_THUMBNAIL_QUALITY = |
| 1571 | new Key<Byte>("android.jpeg.thumbnailQuality", byte.class); |
| 1572 | |
| 1573 | /** |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 1574 | * <p>Resolution of embedded JPEG thumbnail.</p> |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 1575 | * <p>When set to (0, 0) value, the JPEG EXIF will not contain thumbnail, |
| 1576 | * but the captured JPEG will still be a valid image.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1577 | * <p>For best results, when issuing a request for a JPEG image, the thumbnail size selected |
| 1578 | * should have the same aspect ratio as the main JPEG output.</p> |
Zhijun He | 50f7243 | 2014-05-28 13:52:04 -0700 | [diff] [blame] | 1579 | * <p>If the thumbnail image aspect ratio differs from the JPEG primary image aspect |
| 1580 | * ratio, the camera device creates the thumbnail by cropping it from the primary image. |
| 1581 | * For example, if the primary image has 4:3 aspect ratio, the thumbnail image has |
| 1582 | * 16:9 aspect ratio, the primary image will be cropped vertically (letterbox) to |
| 1583 | * generate the thumbnail image. The thumbnail image will always have a smaller Field |
| 1584 | * Of View (FOV) than the primary image when aspect ratios differ.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1585 | * <p><b>Range of valid values:</b><br> |
| 1586 | * {@link CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES android.jpeg.availableThumbnailSizes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1587 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1588 | * |
| 1589 | * @see CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1590 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1591 | @PublicKey |
Igor Murashkin | 72f9f0a | 2014-05-14 15:46:10 -0700 | [diff] [blame] | 1592 | public static final Key<android.util.Size> JPEG_THUMBNAIL_SIZE = |
| 1593 | 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] | 1594 | |
| 1595 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1596 | * <p>The desired lens aperture size, as a ratio of lens focal length to the |
| 1597 | * effective aperture diameter.</p> |
| 1598 | * <p>Setting this value is only supported on the camera devices that have a variable |
| 1599 | * aperture lens.</p> |
Zhijun He | fb46c64 | 2014-01-14 17:57:23 -0800 | [diff] [blame] | 1600 | * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF, |
| 1601 | * 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] | 1602 | * {@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] | 1603 | * to achieve manual exposure control.</p> |
| 1604 | * <p>The requested aperture value may take several frames to reach the |
| 1605 | * requested value; the camera device will report the current (intermediate) |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 1606 | * aperture size in capture result metadata while the aperture is changing. |
| 1607 | * 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] | 1608 | * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of |
| 1609 | * the ON modes, this will be overridden by the camera device |
| 1610 | * auto-exposure algorithm, the overridden values are then provided |
| 1611 | * back to the user in the corresponding result.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1612 | * <p><b>Units</b>: The f-number (f/N)</p> |
| 1613 | * <p><b>Range of valid values:</b><br> |
| 1614 | * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1615 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 1616 | * <p><b>Full capability</b> - |
| 1617 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 1618 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Zhijun He | fb46c64 | 2014-01-14 17:57:23 -0800 | [diff] [blame] | 1619 | * |
Zhijun He | 399f05d | 2014-01-15 11:31:30 -0800 | [diff] [blame] | 1620 | * @see CaptureRequest#CONTROL_AE_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1621 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 1622 | * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 1623 | * @see CaptureResult#LENS_STATE |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 1624 | * @see CaptureRequest#SENSOR_EXPOSURE_TIME |
Eino-Ville Talvala | d8fd679 | 2014-02-10 12:41:04 -0800 | [diff] [blame] | 1625 | * @see CaptureRequest#SENSOR_FRAME_DURATION |
Eino-Ville Talvala | 265b34c | 2014-01-16 16:18:52 -0800 | [diff] [blame] | 1626 | * @see CaptureRequest#SENSOR_SENSITIVITY |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1627 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1628 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1629 | public static final Key<Float> LENS_APERTURE = |
| 1630 | new Key<Float>("android.lens.aperture", float.class); |
| 1631 | |
| 1632 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1633 | * <p>The desired setting for the lens neutral density filter(s).</p> |
| 1634 | * <p>This control will not be supported on most camera devices.</p> |
Ruben Brunk | 855bae4 | 2014-01-17 10:30:32 -0800 | [diff] [blame] | 1635 | * <p>Lens filters are typically used to lower the amount of light the |
| 1636 | * sensor is exposed to (measured in steps of EV). As used here, an EV |
| 1637 | * step is the standard logarithmic representation, which are |
| 1638 | * non-negative, and inversely proportional to the amount of light |
| 1639 | * hitting the sensor. For example, setting this to 0 would result |
| 1640 | * in no reduction of the incoming light, and setting this to 2 would |
| 1641 | * mean that the filter is set to reduce incoming light by two stops |
| 1642 | * (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] | 1643 | * <p>It may take several frames before the lens filter density changes |
| 1644 | * to the requested value. While the filter density is still changing, |
| 1645 | * {@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] | 1646 | * <p><b>Units</b>: Exposure Value (EV)</p> |
| 1647 | * <p><b>Range of valid values:</b><br> |
| 1648 | * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1649 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 1650 | * <p><b>Full capability</b> - |
| 1651 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 1652 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Ruben Brunk | 855bae4 | 2014-01-17 10:30:32 -0800 | [diff] [blame] | 1653 | * |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1654 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Ruben Brunk | 855bae4 | 2014-01-17 10:30:32 -0800 | [diff] [blame] | 1655 | * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 1656 | * @see CaptureResult#LENS_STATE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1657 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1658 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1659 | public static final Key<Float> LENS_FILTER_DENSITY = |
| 1660 | new Key<Float>("android.lens.filterDensity", float.class); |
| 1661 | |
| 1662 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1663 | * <p>The desired lens focal length; used for optical zoom.</p> |
Ruben Brunk | a20f4c2 | 2014-01-17 15:21:13 -0800 | [diff] [blame] | 1664 | * <p>This setting controls the physical focal length of the camera |
| 1665 | * device's lens. Changing the focal length changes the field of |
| 1666 | * view of the camera device, and is usually used for optical zoom.</p> |
| 1667 | * <p>Like {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, this |
| 1668 | * setting won't be applied instantaneously, and it may take several |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 1669 | * frames before the lens can change to the requested focal length. |
Ruben Brunk | a20f4c2 | 2014-01-17 15:21:13 -0800 | [diff] [blame] | 1670 | * While the focal length is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will |
| 1671 | * be set to MOVING.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1672 | * <p>Optical zoom will not be supported on most devices.</p> |
| 1673 | * <p><b>Units</b>: Millimeters</p> |
| 1674 | * <p><b>Range of valid values:</b><br> |
| 1675 | * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1676 | * <p>This key is available on all devices.</p> |
Ruben Brunk | a20f4c2 | 2014-01-17 15:21:13 -0800 | [diff] [blame] | 1677 | * |
| 1678 | * @see CaptureRequest#LENS_APERTURE |
| 1679 | * @see CaptureRequest#LENS_FOCUS_DISTANCE |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1680 | * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS |
Ruben Brunk | a20f4c2 | 2014-01-17 15:21:13 -0800 | [diff] [blame] | 1681 | * @see CaptureResult#LENS_STATE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1682 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1683 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1684 | public static final Key<Float> LENS_FOCAL_LENGTH = |
| 1685 | new Key<Float>("android.lens.focalLength", float.class); |
| 1686 | |
| 1687 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1688 | * <p>Desired distance to plane of sharpest focus, |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 1689 | * measured from frontmost surface of the lens.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1690 | * <p>This control can be used for setting manual focus, on devices that support |
| 1691 | * the MANUAL_SENSOR capability and have a variable-focus lens (see |
| 1692 | * {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance}).</p> |
| 1693 | * <p>A value of <code>0.0f</code> means infinity focus. The value set will be clamped to |
| 1694 | * <code>[0.0f, {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance}]</code>.</p> |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 1695 | * <p>Like {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}, this setting won't be applied |
| 1696 | * instantaneously, and it may take several frames before the lens |
| 1697 | * can move to the requested focus distance. While the lens is still moving, |
| 1698 | * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1699 | * <p>LEGACY devices support at most setting this to <code>0.0f</code> |
| 1700 | * for infinity focus.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1701 | * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p> |
| 1702 | * <p><b>Range of valid values:</b><br> |
| 1703 | * >= 0</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1704 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 1705 | * <p><b>Full capability</b> - |
| 1706 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 1707 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 1708 | * |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1709 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 1710 | * @see CaptureRequest#LENS_FOCAL_LENGTH |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1711 | * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION |
Zhijun He | ca1b73a | 2014-02-03 12:39:53 -0800 | [diff] [blame] | 1712 | * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE |
| 1713 | * @see CaptureResult#LENS_STATE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1714 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1715 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1716 | public static final Key<Float> LENS_FOCUS_DISTANCE = |
| 1717 | new Key<Float>("android.lens.focusDistance", float.class); |
| 1718 | |
| 1719 | /** |
Ruben Brunk | 00849b3 | 2014-01-17 18:30:23 -0800 | [diff] [blame] | 1720 | * <p>Sets whether the camera device uses optical image stabilization (OIS) |
| 1721 | * when capturing images.</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1722 | * <p>OIS is used to compensate for motion blur due to small |
| 1723 | * movements of the camera during capture. Unlike digital image |
| 1724 | * stabilization ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), OIS |
| 1725 | * makes use of mechanical elements to stabilize the camera |
| 1726 | * sensor, and thus allows for longer exposure times before |
| 1727 | * camera shake becomes apparent.</p> |
Zhijun He | 45fa43a1 | 2014-06-13 18:29:37 -0700 | [diff] [blame] | 1728 | * <p>Switching between different optical stabilization modes may take several |
| 1729 | * frames to initialize, the camera device will report the current mode in |
| 1730 | * capture result metadata. For example, When "ON" mode is requested, the |
| 1731 | * optical stabilization modes in the first several capture results may still |
| 1732 | * 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] | 1733 | * <p>If a camera device supports both OIS and digital image stabilization |
| 1734 | * ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), turning both modes on may produce undesirable |
| 1735 | * 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] | 1736 | * <p>Not all devices will support OIS; see |
| 1737 | * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization} for |
| 1738 | * available controls.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1739 | * <p><b>Possible values:</b> |
| 1740 | * <ul> |
| 1741 | * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_OFF OFF}</li> |
| 1742 | * <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_ON ON}</li> |
| 1743 | * </ul></p> |
| 1744 | * <p><b>Available values for this device:</b><br> |
| 1745 | * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1746 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 1747 | * <p><b>Limited capability</b> - |
| 1748 | * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the |
| 1749 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1750 | * |
| 1751 | * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1752 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1753 | * @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1754 | * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF |
| 1755 | * @see #LENS_OPTICAL_STABILIZATION_MODE_ON |
| 1756 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1757 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1758 | public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE = |
| 1759 | new Key<Integer>("android.lens.opticalStabilizationMode", int.class); |
| 1760 | |
| 1761 | /** |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1762 | * <p>Mode of operation for the noise reduction algorithm.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1763 | * <p>The noise reduction algorithm attempts to improve image quality by removing |
| 1764 | * excessive noise added by the capture process, especially in dark conditions. |
| 1765 | * OFF means no noise reduction will be applied by the camera device.</p> |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 1766 | * <p>FAST/HIGH_QUALITY both mean camera device determined noise filtering |
| 1767 | * will be applied. HIGH_QUALITY mode indicates that the camera device |
| 1768 | * will use the highest-quality noise filtering algorithms, |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 1769 | * 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] | 1770 | * slow down capture rate when applying noise filtering.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1771 | * <p><b>Possible values:</b> |
| 1772 | * <ul> |
| 1773 | * <li>{@link #NOISE_REDUCTION_MODE_OFF OFF}</li> |
| 1774 | * <li>{@link #NOISE_REDUCTION_MODE_FAST FAST}</li> |
| 1775 | * <li>{@link #NOISE_REDUCTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li> |
| 1776 | * </ul></p> |
| 1777 | * <p><b>Available values for this device:</b><br> |
| 1778 | * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1779 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 1780 | * <p><b>Full capability</b> - |
| 1781 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 1782 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Ruben Brunk | 6dc379c | 2014-03-04 15:04:00 -0800 | [diff] [blame] | 1783 | * |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1784 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Ruben Brunk | 6dc379c | 2014-03-04 15:04:00 -0800 | [diff] [blame] | 1785 | * @see CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1786 | * @see #NOISE_REDUCTION_MODE_OFF |
| 1787 | * @see #NOISE_REDUCTION_MODE_FAST |
| 1788 | * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY |
| 1789 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1790 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1791 | public static final Key<Integer> NOISE_REDUCTION_MODE = |
| 1792 | new Key<Integer>("android.noiseReduction.mode", int.class); |
| 1793 | |
| 1794 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1795 | * <p>An application-specified ID for the current |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1796 | * request. Must be maintained unchanged in output |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1797 | * frame</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1798 | * <p><b>Units</b>: arbitrary integer assigned by application</p> |
| 1799 | * <p><b>Range of valid values:</b><br> |
| 1800 | * Any int</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1801 | * <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] | 1802 | * @hide |
| 1803 | */ |
| 1804 | public static final Key<Integer> REQUEST_ID = |
| 1805 | new Key<Integer>("android.request.id", int.class); |
| 1806 | |
| 1807 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1808 | * <p>The desired region of the sensor to read out for this capture.</p> |
| 1809 | * <p>This control can be used to implement digital zoom.</p> |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 1810 | * <p>The crop region coordinate system is based off |
| 1811 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being the |
| 1812 | * top-left corner of the sensor active array.</p> |
| 1813 | * <p>Output streams use this rectangle to produce their output, |
| 1814 | * cropping to a smaller region if necessary to maintain the |
| 1815 | * stream's aspect ratio, then scaling the sensor input to |
| 1816 | * match the output's configured resolution.</p> |
| 1817 | * <p>The crop region is applied after the RAW to other color |
| 1818 | * space (e.g. YUV) conversion. Since raw streams |
| 1819 | * (e.g. RAW16) don't have the conversion stage, they are not |
| 1820 | * croppable. The crop region will be ignored by raw streams.</p> |
Zhijun He | 9e6d188 | 2014-05-22 16:47:35 -0700 | [diff] [blame] | 1821 | * <p>For non-raw streams, any additional per-stream cropping will |
| 1822 | * be done to maximize the final pixel area of the stream.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1823 | * <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] | 1824 | * ratio, then 4:3 streams will use the exact crop |
| 1825 | * region. 16:9 streams will further crop vertically |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1826 | * (letterbox).</p> |
| 1827 | * <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] | 1828 | * outputs will crop horizontally (pillarbox), and 16:9 |
| 1829 | * streams will match exactly. These additional crops will |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1830 | * be centered within the crop region.</p> |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 1831 | * <p>The width and height of the crop region cannot |
| 1832 | * be set to be smaller than |
| 1833 | * <code>floor( activeArraySize.width / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code> and |
| 1834 | * <code>floor( activeArraySize.height / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code>, respectively.</p> |
| 1835 | * <p>The camera device may adjust the crop region to account |
| 1836 | * for rounding and other hardware requirements; the final |
| 1837 | * crop region used will be included in the output capture |
| 1838 | * result.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1839 | * <p><b>Units</b>: Pixel coordinates relative to |
| 1840 | * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1841 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | d8fd679 | 2014-02-10 12:41:04 -0800 | [diff] [blame] | 1842 | * |
| 1843 | * @see CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 1844 | * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1845 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1846 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1847 | public static final Key<android.graphics.Rect> SCALER_CROP_REGION = |
| 1848 | new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class); |
| 1849 | |
| 1850 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1851 | * <p>Duration each pixel is exposed to |
| 1852 | * light.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1853 | * <p>If the sensor can't expose this exact duration, it will shorten the |
| 1854 | * duration exposed to the nearest possible value (rather than expose longer). |
| 1855 | * The final exposure time used will be available in the output capture result.</p> |
| 1856 | * <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 |
| 1857 | * OFF; otherwise the auto-exposure algorithm will override this value.</p> |
| 1858 | * <p><b>Units</b>: Nanoseconds</p> |
| 1859 | * <p><b>Range of valid values:</b><br> |
| 1860 | * {@link CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE android.sensor.info.exposureTimeRange}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1861 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 1862 | * <p><b>Full capability</b> - |
| 1863 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 1864 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
| 1865 | * |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1866 | * @see CaptureRequest#CONTROL_AE_MODE |
| 1867 | * @see CaptureRequest#CONTROL_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1868 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1869 | * @see CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1870 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1871 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1872 | public static final Key<Long> SENSOR_EXPOSURE_TIME = |
| 1873 | new Key<Long>("android.sensor.exposureTime", long.class); |
| 1874 | |
| 1875 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 1876 | * <p>Duration from start of frame exposure to |
Igor Murashkin | 143aa0b | 2014-01-17 15:02:34 -0800 | [diff] [blame] | 1877 | * start of next frame exposure.</p> |
| 1878 | * <p>The maximum frame rate that can be supported by a camera subsystem is |
| 1879 | * a function of many factors:</p> |
| 1880 | * <ul> |
| 1881 | * <li>Requested resolutions of output image streams</li> |
| 1882 | * <li>Availability of binning / skipping modes on the imager</li> |
| 1883 | * <li>The bandwidth of the imager interface</li> |
| 1884 | * <li>The bandwidth of the various ISP processing blocks</li> |
| 1885 | * </ul> |
| 1886 | * <p>Since these factors can vary greatly between different ISPs and |
| 1887 | * sensors, the camera abstraction tries to represent the bandwidth |
| 1888 | * restrictions with as simple a model as possible.</p> |
| 1889 | * <p>The model presented has the following characteristics:</p> |
| 1890 | * <ul> |
| 1891 | * <li>The image sensor is always configured to output the smallest |
| 1892 | * resolution possible given the application's requested output stream |
| 1893 | * sizes. The smallest resolution is defined as being at least as large |
| 1894 | * as the largest requested output stream size; the camera pipeline must |
| 1895 | * never digitally upsample sensor data when the crop region covers the |
| 1896 | * whole sensor. In general, this means that if only small output stream |
| 1897 | * resolutions are configured, the sensor can provide a higher frame |
| 1898 | * rate.</li> |
| 1899 | * <li>Since any request may use any or all the currently configured |
| 1900 | * output streams, the sensor and ISP must be configured to support |
| 1901 | * scaling a single capture to all the streams at the same time. This |
| 1902 | * means the camera pipeline must be ready to produce the largest |
| 1903 | * requested output size without any delay. Therefore, the overall |
| 1904 | * frame rate of a given configured stream set is governed only by the |
| 1905 | * largest requested stream resolution.</li> |
| 1906 | * <li>Using more than one output stream in a request does not affect the |
| 1907 | * frame duration.</li> |
Igor Murashkin | a23ffb5 | 2014-02-07 18:52:34 -0800 | [diff] [blame] | 1908 | * <li>Certain format-streams may need to do additional background processing |
| 1909 | * before data is consumed/produced by that stream. These processors |
| 1910 | * can run concurrently to the rest of the camera pipeline, but |
| 1911 | * cannot process more than 1 capture at a time.</li> |
Igor Murashkin | 143aa0b | 2014-01-17 15:02:34 -0800 | [diff] [blame] | 1912 | * </ul> |
| 1913 | * <p>The necessary information for the application, given the model above, |
Igor Murashkin | 9c59517 | 2014-05-12 13:56:20 -0700 | [diff] [blame] | 1914 | * is provided via the {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} field |
| 1915 | * using StreamConfigurationMap#getOutputMinFrameDuration(int, Size). |
Igor Murashkin | 143aa0b | 2014-01-17 15:02:34 -0800 | [diff] [blame] | 1916 | * These are used to determine the maximum frame rate / minimum frame |
| 1917 | * duration that is possible for a given stream configuration.</p> |
| 1918 | * <p>Specifically, the application can use the following rules to |
Igor Murashkin | a23ffb5 | 2014-02-07 18:52:34 -0800 | [diff] [blame] | 1919 | * determine the minimum frame duration it can request from the camera |
Igor Murashkin | 143aa0b | 2014-01-17 15:02:34 -0800 | [diff] [blame] | 1920 | * device:</p> |
| 1921 | * <ol> |
Igor Murashkin | a23ffb5 | 2014-02-07 18:52:34 -0800 | [diff] [blame] | 1922 | * <li>Let the set of currently configured input/output streams |
| 1923 | * be called <code>S</code>.</li> |
| 1924 | * <li>Find the minimum frame durations for each stream in <code>S</code>, by |
Igor Murashkin | 9c59517 | 2014-05-12 13:56:20 -0700 | [diff] [blame] | 1925 | * looking it up in {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} using |
| 1926 | * StreamConfigurationMap#getOutputMinFrameDuration(int, Size) (with |
Igor Murashkin | a23ffb5 | 2014-02-07 18:52:34 -0800 | [diff] [blame] | 1927 | * its respective size/format). Let this set of frame durations be called |
| 1928 | * <code>F</code>.</li> |
| 1929 | * <li>For any given request <code>R</code>, the minimum frame duration allowed |
| 1930 | * for <code>R</code> is the maximum out of all values in <code>F</code>. Let the streams |
| 1931 | * used in <code>R</code> be called <code>S_r</code>.</li> |
Igor Murashkin | 143aa0b | 2014-01-17 15:02:34 -0800 | [diff] [blame] | 1932 | * </ol> |
Igor Murashkin | a23ffb5 | 2014-02-07 18:52:34 -0800 | [diff] [blame] | 1933 | * <p>If none of the streams in <code>S_r</code> have a stall time (listed in |
Igor Murashkin | 9c59517 | 2014-05-12 13:56:20 -0700 | [diff] [blame] | 1934 | * StreamConfigurationMap#getOutputStallDuration(int,Size) using its |
| 1935 | * respective size/format), then the frame duration in |
Igor Murashkin | a23ffb5 | 2014-02-07 18:52:34 -0800 | [diff] [blame] | 1936 | * <code>F</code> determines the steady state frame rate that the application will |
| 1937 | * get if it uses <code>R</code> as a repeating request. Let this special kind |
| 1938 | * of request be called <code>Rsimple</code>.</p> |
| 1939 | * <p>A repeating request <code>Rsimple</code> can be <em>occasionally</em> interleaved |
| 1940 | * by a single capture of a new request <code>Rstall</code> (which has at least |
| 1941 | * one in-use stream with a non-0 stall time) and if <code>Rstall</code> has the |
| 1942 | * same minimum frame duration this will not cause a frame rate loss |
| 1943 | * if all buffers from the previous <code>Rstall</code> have already been |
| 1944 | * delivered.</p> |
| 1945 | * <p>For more details about stalling, see |
Igor Murashkin | 9c59517 | 2014-05-12 13:56:20 -0700 | [diff] [blame] | 1946 | * StreamConfigurationMap#getOutputStallDuration(int,Size).</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1947 | * <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 |
| 1948 | * OFF; otherwise the auto-exposure algorithm will override this value.</p> |
| 1949 | * <p><b>Units</b>: Nanoseconds</p> |
| 1950 | * <p><b>Range of valid values:</b><br> |
| 1951 | * See {@link CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION android.sensor.info.maxFrameDuration}, |
| 1952 | * {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}. The duration |
| 1953 | * is capped to <code>max(duration, exposureTime + overhead)</code>.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1954 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 1955 | * <p><b>Full capability</b> - |
| 1956 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 1957 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Igor Murashkin | 143aa0b | 2014-01-17 15:02:34 -0800 | [diff] [blame] | 1958 | * |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1959 | * @see CaptureRequest#CONTROL_AE_MODE |
| 1960 | * @see CaptureRequest#CONTROL_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1961 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Igor Murashkin | 9c59517 | 2014-05-12 13:56:20 -0700 | [diff] [blame] | 1962 | * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1963 | * @see CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1964 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1965 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1966 | public static final Key<Long> SENSOR_FRAME_DURATION = |
| 1967 | new Key<Long>("android.sensor.frameDuration", long.class); |
| 1968 | |
| 1969 | /** |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 1970 | * <p>The amount of gain applied to sensor data |
| 1971 | * before processing.</p> |
| 1972 | * <p>The sensitivity is the standard ISO sensitivity value, |
| 1973 | * as defined in ISO 12232:2006.</p> |
| 1974 | * <p>The sensitivity must be within {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}, and |
| 1975 | * if if it less than {@link CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY android.sensor.maxAnalogSensitivity}, the camera device |
| 1976 | * is guaranteed to use only analog amplification for applying the gain.</p> |
| 1977 | * <p>If the camera device cannot apply the exact sensitivity |
| 1978 | * requested, it will reduce the gain to the nearest supported |
| 1979 | * value. The final sensitivity used will be available in the |
| 1980 | * output capture result.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 1981 | * <p><b>Units</b>: ISO arithmetic units</p> |
| 1982 | * <p><b>Range of valid values:</b><br> |
| 1983 | * {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1984 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 1985 | * <p><b>Full capability</b> - |
| 1986 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 1987 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 1988 | * |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 1989 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 1990 | * @see CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE |
| 1991 | * @see CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1992 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 1993 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 1994 | public static final Key<Integer> SENSOR_SENSITIVITY = |
| 1995 | new Key<Integer>("android.sensor.sensitivity", int.class); |
| 1996 | |
| 1997 | /** |
Igor Murashkin | c127f05 | 2014-01-17 18:06:02 -0800 | [diff] [blame] | 1998 | * <p>A pixel <code>[R, G_even, G_odd, B]</code> that supplies the test pattern |
| 1999 | * when {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode} is SOLID_COLOR.</p> |
| 2000 | * <p>Each color channel is treated as an unsigned 32-bit integer. |
| 2001 | * The camera device then uses the most significant X bits |
| 2002 | * that correspond to how many bits are in its Bayer raw sensor |
| 2003 | * output.</p> |
| 2004 | * <p>For example, a sensor with RAW10 Bayer output would use the |
| 2005 | * 10 most significant bits from each color channel.</p> |
| 2006 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2007 | * |
| 2008 | * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE |
| 2009 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2010 | @PublicKey |
Igor Murashkin | c127f05 | 2014-01-17 18:06:02 -0800 | [diff] [blame] | 2011 | public static final Key<int[]> SENSOR_TEST_PATTERN_DATA = |
| 2012 | new Key<int[]>("android.sensor.testPatternData", int[].class); |
| 2013 | |
| 2014 | /** |
| 2015 | * <p>When enabled, the sensor sends a test pattern instead of |
| 2016 | * doing a real exposure from the camera.</p> |
| 2017 | * <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] | 2018 | * by android.sensor.* will be ignored. All other controls should |
Igor Murashkin | c127f05 | 2014-01-17 18:06:02 -0800 | [diff] [blame] | 2019 | * work as normal.</p> |
| 2020 | * <p>For example, if manual flash is enabled, flash firing should still |
| 2021 | * occur (and that the test pattern remain unmodified, since the flash |
| 2022 | * would not actually affect it).</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2023 | * <p>Defaults to OFF.</p> |
| 2024 | * <p><b>Possible values:</b> |
| 2025 | * <ul> |
| 2026 | * <li>{@link #SENSOR_TEST_PATTERN_MODE_OFF OFF}</li> |
| 2027 | * <li>{@link #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR SOLID_COLOR}</li> |
| 2028 | * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS COLOR_BARS}</li> |
| 2029 | * <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY COLOR_BARS_FADE_TO_GRAY}</li> |
| 2030 | * <li>{@link #SENSOR_TEST_PATTERN_MODE_PN9 PN9}</li> |
| 2031 | * <li>{@link #SENSOR_TEST_PATTERN_MODE_CUSTOM1 CUSTOM1}</li> |
| 2032 | * </ul></p> |
| 2033 | * <p><b>Available values for this device:</b><br> |
| 2034 | * {@link CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES android.sensor.availableTestPatternModes}</p> |
Igor Murashkin | c127f05 | 2014-01-17 18:06:02 -0800 | [diff] [blame] | 2035 | * <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] | 2036 | * |
| 2037 | * @see CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES |
Igor Murashkin | c127f05 | 2014-01-17 18:06:02 -0800 | [diff] [blame] | 2038 | * @see #SENSOR_TEST_PATTERN_MODE_OFF |
| 2039 | * @see #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR |
| 2040 | * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS |
| 2041 | * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY |
| 2042 | * @see #SENSOR_TEST_PATTERN_MODE_PN9 |
| 2043 | * @see #SENSOR_TEST_PATTERN_MODE_CUSTOM1 |
| 2044 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2045 | @PublicKey |
Igor Murashkin | c127f05 | 2014-01-17 18:06:02 -0800 | [diff] [blame] | 2046 | public static final Key<Integer> SENSOR_TEST_PATTERN_MODE = |
| 2047 | new Key<Integer>("android.sensor.testPatternMode", int.class); |
| 2048 | |
| 2049 | /** |
Zhijun He | ba93fe6 | 2014-01-17 16:43:05 -0800 | [diff] [blame] | 2050 | * <p>Quality of lens shading correction applied |
| 2051 | * to the image data.</p> |
| 2052 | * <p>When set to OFF mode, no lens shading correction will be applied by the |
| 2053 | * camera device, and an identity lens shading map data will be provided |
| 2054 | * 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] | 2055 | * shading map with size of <code>[ 4, 3 ]</code>, |
| 2056 | * the output {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap} for this case will be an identity |
| 2057 | * map shown below:</p> |
Zhijun He | ba93fe6 | 2014-01-17 16:43:05 -0800 | [diff] [blame] | 2058 | * <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] | 2059 | * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, |
| 2060 | * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, |
| 2061 | * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, |
| 2062 | * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, |
| 2063 | * 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] | 2064 | * </code></pre> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2065 | * <p>When set to other modes, lens shading correction will be applied by the camera |
| 2066 | * device. Applications can request lens shading map data by setting |
| 2067 | * {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} to ON, and then the camera device will provide lens |
| 2068 | * shading map data in {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap}; the returned shading map |
| 2069 | * data will be the one applied by the camera device for this capture request.</p> |
| 2070 | * <p>The shading map data may depend on the auto-exposure (AE) and AWB statistics, therefore |
| 2071 | * the reliability of the map data may be affected by the AE and AWB algorithms. When AE and |
| 2072 | * 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> |
| 2073 | * OFF), to get best results, it is recommended that the applications wait for the AE and AWB |
| 2074 | * to be converged before using the returned shading map data.</p> |
| 2075 | * <p><b>Possible values:</b> |
| 2076 | * <ul> |
| 2077 | * <li>{@link #SHADING_MODE_OFF OFF}</li> |
| 2078 | * <li>{@link #SHADING_MODE_FAST FAST}</li> |
| 2079 | * <li>{@link #SHADING_MODE_HIGH_QUALITY HIGH_QUALITY}</li> |
| 2080 | * </ul></p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2081 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2082 | * <p><b>Full capability</b> - |
| 2083 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 2084 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Zhijun He | ba93fe6 | 2014-01-17 16:43:05 -0800 | [diff] [blame] | 2085 | * |
Zhijun He | fa7c755 | 2014-05-22 16:36:02 -0700 | [diff] [blame] | 2086 | * @see CaptureRequest#CONTROL_AE_MODE |
| 2087 | * @see CaptureRequest#CONTROL_AWB_MODE |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2088 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2089 | * @see CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP |
Zhijun He | ba93fe6 | 2014-01-17 16:43:05 -0800 | [diff] [blame] | 2090 | * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE |
| 2091 | * @see #SHADING_MODE_OFF |
| 2092 | * @see #SHADING_MODE_FAST |
| 2093 | * @see #SHADING_MODE_HIGH_QUALITY |
Zhijun He | ba93fe6 | 2014-01-17 16:43:05 -0800 | [diff] [blame] | 2094 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2095 | @PublicKey |
Zhijun He | ba93fe6 | 2014-01-17 16:43:05 -0800 | [diff] [blame] | 2096 | public static final Key<Integer> SHADING_MODE = |
| 2097 | new Key<Integer>("android.shading.mode", int.class); |
| 2098 | |
| 2099 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2100 | * <p>Operating mode for the face detector |
Eino-Ville Talvala | b67a3b3 | 2014-06-06 13:07:20 -0700 | [diff] [blame] | 2101 | * unit.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2102 | * <p>Whether face detection is enabled, and whether it |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2103 | * should output just the basic fields or the full set of |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2104 | * fields.</p> |
| 2105 | * <p><b>Possible values:</b> |
| 2106 | * <ul> |
| 2107 | * <li>{@link #STATISTICS_FACE_DETECT_MODE_OFF OFF}</li> |
| 2108 | * <li>{@link #STATISTICS_FACE_DETECT_MODE_SIMPLE SIMPLE}</li> |
| 2109 | * <li>{@link #STATISTICS_FACE_DETECT_MODE_FULL FULL}</li> |
| 2110 | * </ul></p> |
| 2111 | * <p><b>Available values for this device:</b><br> |
| 2112 | * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}</p> |
| 2113 | * <p>This key is available on all devices.</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 2114 | * |
| 2115 | * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2116 | * @see #STATISTICS_FACE_DETECT_MODE_OFF |
| 2117 | * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE |
| 2118 | * @see #STATISTICS_FACE_DETECT_MODE_FULL |
| 2119 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2120 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2121 | public static final Key<Integer> STATISTICS_FACE_DETECT_MODE = |
| 2122 | new Key<Integer>("android.statistics.faceDetectMode", int.class); |
| 2123 | |
| 2124 | /** |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2125 | * <p>Operating mode for hot pixel map generation.</p> |
| 2126 | * <p>If set to <code>true</code>, a hot pixel map is returned in {@link CaptureResult#STATISTICS_HOT_PIXEL_MAP android.statistics.hotPixelMap}. |
| 2127 | * If set to <code>false</code>, no hot pixel map will be returned.</p> |
| 2128 | * <p><b>Range of valid values:</b><br> |
| 2129 | * {@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] | 2130 | * <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] | 2131 | * |
| 2132 | * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP |
| 2133 | * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES |
| 2134 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2135 | @PublicKey |
Ruben Brunk | 9d454fd | 2014-03-04 14:11:52 -0800 | [diff] [blame] | 2136 | public static final Key<Boolean> STATISTICS_HOT_PIXEL_MAP_MODE = |
| 2137 | new Key<Boolean>("android.statistics.hotPixelMapMode", boolean.class); |
| 2138 | |
| 2139 | /** |
Zhijun He | cc28a41 | 2014-02-24 15:11:23 -0800 | [diff] [blame] | 2140 | * <p>Whether the camera device will output the lens |
| 2141 | * shading map in output result metadata.</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2142 | * <p>When set to ON, |
Eino-Ville Talvala | e600d6a | 2014-06-09 14:25:50 -0700 | [diff] [blame] | 2143 | * android.statistics.lensShadingMap will be provided in |
Igor Murashkin | 7a9b30e | 2013-12-11 13:31:38 -0800 | [diff] [blame] | 2144 | * the output result metadata.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2145 | * <p>ON is always supported on devices with the RAW capability.</p> |
| 2146 | * <p><b>Possible values:</b> |
| 2147 | * <ul> |
| 2148 | * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_OFF OFF}</li> |
| 2149 | * <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_ON ON}</li> |
| 2150 | * </ul></p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2151 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2152 | * <p><b>Full capability</b> - |
| 2153 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 2154 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
| 2155 | * |
| 2156 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | d96748b | 2013-09-12 11:11:27 -0700 | [diff] [blame] | 2157 | * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF |
| 2158 | * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON |
| 2159 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2160 | @PublicKey |
Eino-Ville Talvala | d96748b | 2013-09-12 11:11:27 -0700 | [diff] [blame] | 2161 | public static final Key<Integer> STATISTICS_LENS_SHADING_MAP_MODE = |
| 2162 | new Key<Integer>("android.statistics.lensShadingMapMode", int.class); |
| 2163 | |
| 2164 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2165 | * <p>Tonemapping / contrast / gamma curve for the blue |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 2166 | * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is |
| 2167 | * CONTRAST_CURVE.</p> |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 2168 | * <p>See android.tonemap.curveRed for more details.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2169 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2170 | * <p><b>Full capability</b> - |
| 2171 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 2172 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 2173 | * |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2174 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 2175 | * @see CaptureRequest#TONEMAP_MODE |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 2176 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2177 | */ |
Zhijun He | 3ffd705 | 2013-08-19 15:45:08 -0700 | [diff] [blame] | 2178 | public static final Key<float[]> TONEMAP_CURVE_BLUE = |
| 2179 | new Key<float[]>("android.tonemap.curveBlue", float[].class); |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2180 | |
| 2181 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2182 | * <p>Tonemapping / contrast / gamma curve for the green |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 2183 | * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is |
| 2184 | * CONTRAST_CURVE.</p> |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 2185 | * <p>See android.tonemap.curveRed for more details.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2186 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2187 | * <p><b>Full capability</b> - |
| 2188 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 2189 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 2190 | * |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2191 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Zhijun He | 5f2a47f | 2014-01-16 15:44:41 -0800 | [diff] [blame] | 2192 | * @see CaptureRequest#TONEMAP_MODE |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 2193 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2194 | */ |
Zhijun He | 3ffd705 | 2013-08-19 15:45:08 -0700 | [diff] [blame] | 2195 | public static final Key<float[]> TONEMAP_CURVE_GREEN = |
| 2196 | new Key<float[]>("android.tonemap.curveGreen", float[].class); |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2197 | |
| 2198 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2199 | * <p>Tonemapping / contrast / gamma curve for the red |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 2200 | * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is |
| 2201 | * CONTRAST_CURVE.</p> |
| 2202 | * <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] | 2203 | * <pre><code>android.tonemap.curveRed = |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2204 | * [ P0in, P0out, P1in, P1out, P2in, P2out, P3in, P3out, ..., PNin, PNout ] |
Zhijun He | 870922b | 2014-02-15 21:47:51 -0800 | [diff] [blame] | 2205 | * 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] | 2206 | * <p>These are sorted in order of increasing <code>Pin</code>; it is |
| 2207 | * 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] | 2208 | * define a complete mapping. For input values between control points, |
| 2209 | * the camera device must linearly interpolate between the control |
| 2210 | * points.</p> |
| 2211 | * <p>Each curve can have an independent number of points, and the number |
| 2212 | * of points can be less than max (that is, the request doesn't have to |
| 2213 | * always provide a curve with number of points equivalent to |
| 2214 | * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p> |
| 2215 | * <p>A few examples, and their corresponding graphical mappings; these |
| 2216 | * only specify the red channel and the precision is limited to 4 |
| 2217 | * digits, for conciseness.</p> |
| 2218 | * <p>Linear mapping:</p> |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 2219 | * <pre><code>android.tonemap.curveRed = [ 0, 0, 1.0, 1.0 ] |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 2220 | * </code></pre> |
| 2221 | * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p> |
| 2222 | * <p>Invert mapping:</p> |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 2223 | * <pre><code>android.tonemap.curveRed = [ 0, 1.0, 1.0, 0 ] |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 2224 | * </code></pre> |
| 2225 | * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p> |
| 2226 | * <p>Gamma 1/2.2 mapping, with 16 control points:</p> |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 2227 | * <pre><code>android.tonemap.curveRed = [ |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2228 | * 0.0000, 0.0000, 0.0667, 0.2920, 0.1333, 0.4002, 0.2000, 0.4812, |
| 2229 | * 0.2667, 0.5484, 0.3333, 0.6069, 0.4000, 0.6594, 0.4667, 0.7072, |
| 2230 | * 0.5333, 0.7515, 0.6000, 0.7928, 0.6667, 0.8317, 0.7333, 0.8685, |
| 2231 | * 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] | 2232 | * </code></pre> |
| 2233 | * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p> |
| 2234 | * <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] | 2235 | * <pre><code>android.tonemap.curveRed = [ |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2236 | * 0.0000, 0.0000, 0.0667, 0.2864, 0.1333, 0.4007, 0.2000, 0.4845, |
| 2237 | * 0.2667, 0.5532, 0.3333, 0.6125, 0.4000, 0.6652, 0.4667, 0.7130, |
| 2238 | * 0.5333, 0.7569, 0.6000, 0.7977, 0.6667, 0.8360, 0.7333, 0.8721, |
| 2239 | * 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] | 2240 | * </code></pre> |
| 2241 | * <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] | 2242 | * <p><b>Range of valid values:</b><br> |
| 2243 | * 0-1 on both input and output coordinates, normalized |
| 2244 | * 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] | 2245 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2246 | * <p><b>Full capability</b> - |
| 2247 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 2248 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 2249 | * |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2250 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 2251 | * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS |
Eino-Ville Talvala | 0da8bf5 | 2014-01-08 16:18:35 -0800 | [diff] [blame] | 2252 | * @see CaptureRequest#TONEMAP_MODE |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 2253 | * @hide |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2254 | */ |
| 2255 | public static final Key<float[]> TONEMAP_CURVE_RED = |
| 2256 | new Key<float[]>("android.tonemap.curveRed", float[].class); |
| 2257 | |
| 2258 | /** |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 2259 | * <p>Tonemapping / contrast / gamma curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} |
| 2260 | * is CONTRAST_CURVE.</p> |
| 2261 | * <p>The tonemapCurve consist of three curves for each of red, green, and blue |
| 2262 | * channels respectively. The following example uses the red channel as an |
| 2263 | * example. The same logic applies to green and blue channel. |
| 2264 | * Each channel's curve is defined by an array of control points:</p> |
| 2265 | * <pre><code>curveRed = |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2266 | * [ 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] | 2267 | * 2 <= N <= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre> |
| 2268 | * <p>These are sorted in order of increasing <code>Pin</code>; it is always |
| 2269 | * guaranteed that input values 0.0 and 1.0 are included in the list to |
| 2270 | * define a complete mapping. For input values between control points, |
| 2271 | * the camera device must linearly interpolate between the control |
| 2272 | * points.</p> |
| 2273 | * <p>Each curve can have an independent number of points, and the number |
| 2274 | * of points can be less than max (that is, the request doesn't have to |
| 2275 | * always provide a curve with number of points equivalent to |
| 2276 | * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p> |
| 2277 | * <p>A few examples, and their corresponding graphical mappings; these |
| 2278 | * only specify the red channel and the precision is limited to 4 |
| 2279 | * digits, for conciseness.</p> |
| 2280 | * <p>Linear mapping:</p> |
| 2281 | * <pre><code>curveRed = [ (0, 0), (1.0, 1.0) ] |
| 2282 | * </code></pre> |
| 2283 | * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p> |
| 2284 | * <p>Invert mapping:</p> |
| 2285 | * <pre><code>curveRed = [ (0, 1.0), (1.0, 0) ] |
| 2286 | * </code></pre> |
| 2287 | * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p> |
| 2288 | * <p>Gamma 1/2.2 mapping, with 16 control points:</p> |
| 2289 | * <pre><code>curveRed = [ |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2290 | * (0.0000, 0.0000), (0.0667, 0.2920), (0.1333, 0.4002), (0.2000, 0.4812), |
| 2291 | * (0.2667, 0.5484), (0.3333, 0.6069), (0.4000, 0.6594), (0.4667, 0.7072), |
| 2292 | * (0.5333, 0.7515), (0.6000, 0.7928), (0.6667, 0.8317), (0.7333, 0.8685), |
| 2293 | * (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] | 2294 | * </code></pre> |
| 2295 | * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p> |
| 2296 | * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p> |
| 2297 | * <pre><code>curveRed = [ |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2298 | * (0.0000, 0.0000), (0.0667, 0.2864), (0.1333, 0.4007), (0.2000, 0.4845), |
| 2299 | * (0.2667, 0.5532), (0.3333, 0.6125), (0.4000, 0.6652), (0.4667, 0.7130), |
| 2300 | * (0.5333, 0.7569), (0.6000, 0.7977), (0.6667, 0.8360), (0.7333, 0.8721), |
| 2301 | * (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] | 2302 | * </code></pre> |
| 2303 | * <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] | 2304 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2305 | * <p><b>Full capability</b> - |
| 2306 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 2307 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 2308 | * |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2309 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 2310 | * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS |
| 2311 | * @see CaptureRequest#TONEMAP_MODE |
| 2312 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2313 | @PublicKey |
| 2314 | @SyntheticKey |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 2315 | public static final Key<android.hardware.camera2.params.TonemapCurve> TONEMAP_CURVE = |
| 2316 | new Key<android.hardware.camera2.params.TonemapCurve>("android.tonemap.curve", android.hardware.camera2.params.TonemapCurve.class); |
| 2317 | |
| 2318 | /** |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 2319 | * <p>High-level global contrast/gamma/tonemapping control.</p> |
| 2320 | * <p>When switching to an application-defined contrast curve by setting |
| 2321 | * {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} to CONTRAST_CURVE, the curve is defined |
| 2322 | * per-channel with a set of <code>(in, out)</code> points that specify the |
| 2323 | * mapping from input high-bit-depth pixel value to the output |
| 2324 | * low-bit-depth value. Since the actual pixel ranges of both input |
| 2325 | * and output may change depending on the camera pipeline, the values |
| 2326 | * are specified by normalized floating-point numbers.</p> |
| 2327 | * <p>More-complex color mapping operations such as 3D color look-up |
| 2328 | * tables, selective chroma enhancement, or other non-linear color |
| 2329 | * transforms will be disabled when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is |
| 2330 | * CONTRAST_CURVE.</p> |
| 2331 | * <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] | 2332 | * 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] | 2333 | * These values are always available, and as close as possible to the |
| 2334 | * actually used nonlinear/nonglobal transforms.</p> |
Zhijun He | fa7c755 | 2014-05-22 16:36:02 -0700 | [diff] [blame] | 2335 | * <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] | 2336 | * provided curve in FAST or HIGH_QUALITY, the image's tonemap will be |
| 2337 | * roughly the same.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2338 | * <p><b>Possible values:</b> |
| 2339 | * <ul> |
| 2340 | * <li>{@link #TONEMAP_MODE_CONTRAST_CURVE CONTRAST_CURVE}</li> |
| 2341 | * <li>{@link #TONEMAP_MODE_FAST FAST}</li> |
| 2342 | * <li>{@link #TONEMAP_MODE_HIGH_QUALITY HIGH_QUALITY}</li> |
| 2343 | * </ul></p> |
| 2344 | * <p><b>Available values for this device:</b><br> |
| 2345 | * {@link CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES android.tonemap.availableToneMapModes}</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2346 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2347 | * <p><b>Full capability</b> - |
| 2348 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 2349 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
Igor Murashkin | 3242f4f | 2014-01-15 12:27:41 -0800 | [diff] [blame] | 2350 | * |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2351 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Ruben Brunk | 6dc379c | 2014-03-04 15:04:00 -0800 | [diff] [blame] | 2352 | * @see CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES |
Yin-Chia Yeh | 8490ace | 2014-05-27 10:04:54 -0700 | [diff] [blame] | 2353 | * @see CaptureRequest#TONEMAP_CURVE |
Igor Murashkin | e006093 | 2014-01-17 17:24:11 -0800 | [diff] [blame] | 2354 | * @see CaptureRequest#TONEMAP_MODE |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2355 | * @see #TONEMAP_MODE_CONTRAST_CURVE |
| 2356 | * @see #TONEMAP_MODE_FAST |
| 2357 | * @see #TONEMAP_MODE_HIGH_QUALITY |
| 2358 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2359 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2360 | public static final Key<Integer> TONEMAP_MODE = |
| 2361 | new Key<Integer>("android.tonemap.mode", int.class); |
| 2362 | |
| 2363 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2364 | * <p>This LED is nominally used to indicate to the user |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2365 | * that the camera is powered on and may be streaming images back to the |
| 2366 | * Application Processor. In certain rare circumstances, the OS may |
| 2367 | * disable this when video is processed locally and not transmitted to |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2368 | * any untrusted applications.</p> |
| 2369 | * <p>In particular, the LED <em>must</em> always be on when the data could be |
| 2370 | * transmitted off the device. The LED <em>should</em> always be on whenever |
| 2371 | * data is stored locally on the device.</p> |
| 2372 | * <p>The LED <em>may</em> be off if a trusted application is using the data that |
| 2373 | * doesn't violate the above rules.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2374 | * <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] | 2375 | * @hide |
| 2376 | */ |
| 2377 | public static final Key<Boolean> LED_TRANSMIT = |
| 2378 | new Key<Boolean>("android.led.transmit", boolean.class); |
| 2379 | |
| 2380 | /** |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2381 | * <p>Whether black-level compensation is locked |
Eino-Ville Talvala | 0956af5 | 2013-12-26 13:19:10 -0800 | [diff] [blame] | 2382 | * to its current values, or is free to vary.</p> |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2383 | * <p>When set to <code>true</code> (ON), the values used for black-level |
Eino-Ville Talvala | 0956af5 | 2013-12-26 13:19:10 -0800 | [diff] [blame] | 2384 | * compensation will not change until the lock is set to |
Eino-Ville Talvala | fd3e289 | 2014-10-06 10:23:55 -0700 | [diff] [blame] | 2385 | * <code>false</code> (OFF).</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2386 | * <p>Since changes to certain capture parameters (such as |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2387 | * exposure time) may require resetting of black level |
Eino-Ville Talvala | 0956af5 | 2013-12-26 13:19:10 -0800 | [diff] [blame] | 2388 | * compensation, the camera device must report whether setting |
| 2389 | * the black level lock was successful in the output result |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2390 | * metadata.</p> |
| 2391 | * <p>For example, if a sequence of requests is as follows:</p> |
| 2392 | * <ul> |
| 2393 | * <li>Request 1: Exposure = 10ms, Black level lock = OFF</li> |
| 2394 | * <li>Request 2: Exposure = 10ms, Black level lock = ON</li> |
| 2395 | * <li>Request 3: Exposure = 10ms, Black level lock = ON</li> |
| 2396 | * <li>Request 4: Exposure = 20ms, Black level lock = ON</li> |
| 2397 | * <li>Request 5: Exposure = 20ms, Black level lock = ON</li> |
| 2398 | * <li>Request 6: Exposure = 20ms, Black level lock = ON</li> |
| 2399 | * </ul> |
Eino-Ville Talvala | 0956af5 | 2013-12-26 13:19:10 -0800 | [diff] [blame] | 2400 | * <p>And the exposure change in Request 4 requires the camera |
| 2401 | * device to reset the black level offsets, then the output |
| 2402 | * result metadata is expected to be:</p> |
Igor Murashkin | ace5bf0 | 2013-12-10 17:36:40 -0800 | [diff] [blame] | 2403 | * <ul> |
| 2404 | * <li>Result 1: Exposure = 10ms, Black level lock = OFF</li> |
| 2405 | * <li>Result 2: Exposure = 10ms, Black level lock = ON</li> |
| 2406 | * <li>Result 3: Exposure = 10ms, Black level lock = ON</li> |
| 2407 | * <li>Result 4: Exposure = 20ms, Black level lock = OFF</li> |
| 2408 | * <li>Result 5: Exposure = 20ms, Black level lock = ON</li> |
| 2409 | * <li>Result 6: Exposure = 20ms, Black level lock = ON</li> |
| 2410 | * </ul> |
Eino-Ville Talvala | 0956af5 | 2013-12-26 13:19:10 -0800 | [diff] [blame] | 2411 | * <p>This indicates to the application that on frame 4, black |
| 2412 | * levels were reset due to exposure value changes, and pixel |
| 2413 | * values may not be consistent across captures.</p> |
| 2414 | * <p>The camera device will maintain the lock to the extent |
| 2415 | * possible, only overriding the lock to OFF when changes to |
| 2416 | * other request parameters require a black level recalculation |
| 2417 | * or reset.</p> |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2418 | * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> |
| 2419 | * <p><b>Full capability</b> - |
| 2420 | * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the |
| 2421 | * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p> |
| 2422 | * |
| 2423 | * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2424 | */ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2425 | @PublicKey |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2426 | public static final Key<Boolean> BLACK_LEVEL_LOCK = |
| 2427 | new Key<Boolean>("android.blackLevel.lock", boolean.class); |
| 2428 | |
| 2429 | /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ |
| 2430 | * End generated code |
| 2431 | *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/ |
Igor Murashkin | 6c76f58 | 2014-07-15 17:19:49 -0700 | [diff] [blame] | 2432 | |
Igor Murashkin | 4b8cd6b | 2014-10-02 16:00:52 -0700 | [diff] [blame] | 2433 | |
| 2434 | |
Eino-Ville Talvala | 5a32b20c | 2013-08-08 12:38:36 -0700 | [diff] [blame] | 2435 | } |