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