blob: d23eafa9eeaa489cc29f83dea76c96308befa4bb [file] [log] [blame]
Eino-Ville Talvalab2675542012-12-12 13:29:45 -08001/*
2 * Copyright (C) 2012 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Eino-Ville Talvala2f1a2e42013-07-25 17:12:05 -070017package android.hardware.camera2;
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080018
Eino-Ville Talvala70c22072013-08-27 12:09:04 -070019import android.hardware.camera2.impl.CameraMetadataNative;
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080020
21/**
22 * <p>The results of a single image capture from the image sensor.</p>
23 *
24 * <p>Contains the final configuration for the capture hardware (sensor, lens,
25 * flash), the processing pipeline, the control algorithms, and the output
26 * buffers.</p>
27 *
28 * <p>CaptureResults are produced by a {@link CameraDevice} after processing a
29 * {@link CaptureRequest}. All properties listed for capture requests can also
30 * be queried on the capture result, to determine the final values used for
31 * capture. The result also includes additional metadata about the state of the
32 * camera device during the capture.</p>
33 *
34 */
35public final class CaptureResult extends CameraMetadata {
Eino-Ville Talvala70c22072013-08-27 12:09:04 -070036
37 private final CameraMetadataNative mResults;
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -070038 private final CaptureRequest mRequest;
39 private final int mSequenceId;
Eino-Ville Talvala70c22072013-08-27 12:09:04 -070040
Igor Murashkin70725502013-06-25 20:27:06 +000041 /**
Eino-Ville Talvala70c22072013-08-27 12:09:04 -070042 * Takes ownership of the passed-in properties object
Igor Murashkin70725502013-06-25 20:27:06 +000043 * @hide
44 */
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -070045 public CaptureResult(CameraMetadataNative results, CaptureRequest parent, int sequenceId) {
46 if (results == null) {
47 throw new IllegalArgumentException("results was null");
48 }
49
50 if (parent == null) {
51 throw new IllegalArgumentException("parent was null");
52 }
53
Eino-Ville Talvala70c22072013-08-27 12:09:04 -070054 mResults = results;
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -070055 mRequest = parent;
56 mSequenceId = sequenceId;
Eino-Ville Talvala70c22072013-08-27 12:09:04 -070057 }
58
59 @Override
60 public <T> T get(Key<T> key) {
61 return mResults.get(key);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -080062 }
63
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -070064 /**
65 * Get the request associated with this result.
66 *
67 * <p>Whenever a request is successfully captured, with
68 * {@link CameraDevice.CaptureListener#onCaptureCompleted},
69 * the {@code result}'s {@code getRequest()} will return that {@code request}.
70 * </p>
71 *
72 * <p>In particular,
73 * <code><pre>cameraDevice.capture(someRequest, new CaptureListener() {
74 * {@literal @}Override
75 * void onCaptureCompleted(CaptureRequest myRequest, CaptureResult myResult) {
76 * assert(myResult.getRequest.equals(myRequest) == true);
77 * }
78 * };
79 * </code></pre>
80 * </p>
81 *
82 * @return The request associated with this result. Never {@code null}.
83 */
84 public CaptureRequest getRequest() {
85 return mRequest;
86 }
87
88 /**
89 * Get the frame number associated with this result.
90 *
91 * <p>Whenever a request has been processed, regardless of failure or success,
92 * it gets a unique frame number assigned to its future result/failure.</p>
93 *
94 * <p>This value monotonically increments, starting with 0,
95 * for every new result or failure; and the scope is the lifetime of the
96 * {@link CameraDevice}.</p>
97 *
98 * @return int frame number
99 */
100 public int getFrameNumber() {
101 return get(REQUEST_FRAME_COUNT);
102 }
103
104 /**
105 * The sequence ID for this failure that was returned by the
106 * {@link CameraDevice#capture} family of functions.
107 *
108 * <p>The sequence ID is a unique monotonically increasing value starting from 0,
109 * incremented every time a new group of requests is submitted to the CameraDevice.</p>
110 *
111 * @return int The ID for the sequence of requests that this capture result is a part of
112 *
113 * @see CameraDevice.CaptureListener#onCaptureSequenceCompleted
114 */
115 public int getSequenceId() {
116 return mSequenceId;
117 }
118
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700119 /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
120 * The key entries below this point are generated from metadata
121 * definitions in /system/media/camera/docs. Do not modify by hand or
122 * modify the comment blocks at the start or end.
123 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/
124
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800125
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700126 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800127 * <p>A color transform matrix to use to transform
128 * from sensor RGB color space to output linear sRGB color space</p>
129 * <p>This matrix is either set by HAL when the request
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800130 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700131 * directly by the application in the request when the
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800132 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -0800133 * <p>In the latter case, the HAL may round the matrix to account
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700134 * for precision issues; the final rounded matrix should be
Igor Murashkinace5bf02013-12-10 17:36:40 -0800135 * reported back in this matrix result metadata.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800136 *
137 * @see CaptureRequest#COLOR_CORRECTION_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700138 */
139 public static final Key<Rational[]> COLOR_CORRECTION_TRANSFORM =
140 new Key<Rational[]>("android.colorCorrection.transform", Rational[].class);
141
142 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800143 * <p>Gains applying to Bayer color channels for
144 * white-balance</p>
145 * <p>The 4-channel white-balance gains are defined in
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700146 * the order of [R G_even G_odd B], where G_even is the gain
147 * for green pixels on even rows of the output, and G_odd
148 * is the gain for greenpixels on the odd rows. if a HAL
149 * does not support a separate gain for even/odd green channels,
150 * it should use the G_even value,and write G_odd equal to
Igor Murashkinace5bf02013-12-10 17:36:40 -0800151 * G_even in the output result metadata.</p>
152 * <p>This array is either set by HAL when the request
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800153 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or
Igor Murashkind5ff06a2013-08-20 15:15:06 -0700154 * directly by the application in the request when the
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800155 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -0800156 * <p>The ouput should be the gains actually applied by the HAL to
157 * the current frame.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800158 *
159 * @see CaptureRequest#COLOR_CORRECTION_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700160 */
161 public static final Key<float[]> COLOR_CORRECTION_GAINS =
162 new Key<float[]>("android.colorCorrection.gains", float[].class);
163
164 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800165 * <p>The ID sent with the latest
166 * CAMERA2_TRIGGER_PRECAPTURE_METERING call</p>
167 * <p>Must be 0 if no
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700168 * CAMERA2_TRIGGER_PRECAPTURE_METERING trigger received yet
169 * by HAL. Always updated even if AE algorithm ignores the
Igor Murashkinace5bf02013-12-10 17:36:40 -0800170 * trigger</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700171 * @hide
172 */
173 public static final Key<Integer> CONTROL_AE_PRECAPTURE_ID =
174 new Key<Integer>("android.control.aePrecaptureId", int.class);
175
176 /**
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800177 * <p>The desired mode for the camera device's
178 * auto-exposure routine.</p>
179 * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is
180 * AUTO.</p>
181 * <p>When set to any of the ON modes, the camera device's
182 * auto-exposure routine is enabled, overriding the
183 * application's selected exposure time, sensor sensitivity,
184 * and frame duration ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
185 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and
186 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}). If one of the FLASH modes
187 * is selected, the camera device's flash unit controls are
188 * also overridden.</p>
189 * <p>The FLASH modes are only available if the camera device
190 * has a flash unit ({@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} is <code>true</code>).</p>
191 * <p>If flash TORCH mode is desired, this field must be set to
192 * ON or OFF, and {@link CaptureRequest#FLASH_MODE android.flash.mode} set to TORCH.</p>
193 * <p>When set to any of the ON modes, the values chosen by the
194 * camera device auto-exposure routine for the overridden
195 * fields for a given capture will be available in its
196 * CaptureResult.</p>
197 *
Igor Murashkinaef3b7e2014-01-15 13:20:37 -0800198 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
199 * @see CaptureRequest#SENSOR_FRAME_DURATION
Zhijun He399f05d2014-01-15 11:31:30 -0800200 * @see CaptureRequest#SENSOR_SENSITIVITY
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800201 * @see CaptureRequest#FLASH_MODE
202 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
203 * @see CaptureRequest#CONTROL_MODE
204 * @see #CONTROL_AE_MODE_OFF
205 * @see #CONTROL_AE_MODE_ON
206 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH
207 * @see #CONTROL_AE_MODE_ON_ALWAYS_FLASH
208 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE
209 */
210 public static final Key<Integer> CONTROL_AE_MODE =
211 new Key<Integer>("android.control.aeMode", int.class);
212
213 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800214 * <p>List of areas to use for
215 * metering</p>
216 * <p>Each area is a rectangle plus weight: xmin, ymin,
Timothy Knight2629f272013-09-03 17:23:23 -0700217 * xmax, ymax, weight. The rectangle is defined inclusive of the
Igor Murashkinace5bf02013-12-10 17:36:40 -0800218 * specified coordinates.</p>
219 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -0700220 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800221 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
222 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Timothy Knight2629f272013-09-03 17:23:23 -0700223 * bottom-right pixel in the active pixel array. The weight
Igor Murashkinace5bf02013-12-10 17:36:40 -0800224 * should be nonnegative.</p>
225 * <p>If all regions have 0 weight, then no specific metering area
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700226 * needs to be used by the HAL. If the metering region is
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800227 * outside the current {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, the HAL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700228 * should ignore the sections outside the region and output the
Igor Murashkinace5bf02013-12-10 17:36:40 -0800229 * used sections in the frame metadata</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800230 *
231 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
232 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700233 */
234 public static final Key<int[]> CONTROL_AE_REGIONS =
235 new Key<int[]>("android.control.aeRegions", int[].class);
236
237 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800238 * <p>Current state of AE algorithm</p>
239 * <p>Whenever the AE algorithm state changes, a
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700240 * MSG_AUTOEXPOSURE notification must be send if a
Igor Murashkinace5bf02013-12-10 17:36:40 -0800241 * notification callback is registered.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700242 * @see #CONTROL_AE_STATE_INACTIVE
243 * @see #CONTROL_AE_STATE_SEARCHING
244 * @see #CONTROL_AE_STATE_CONVERGED
245 * @see #CONTROL_AE_STATE_LOCKED
246 * @see #CONTROL_AE_STATE_FLASH_REQUIRED
247 * @see #CONTROL_AE_STATE_PRECAPTURE
248 */
249 public static final Key<Integer> CONTROL_AE_STATE =
250 new Key<Integer>("android.control.aeState", int.class);
251
252 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800253 * <p>Whether AF is currently enabled, and what
254 * mode it is set to</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800255 * <p>Only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} = AUTO.</p>
Zhijun He78146ec2014-01-14 18:12:13 -0800256 * <p>If the lens is controlled by the camera device auto-focus algorithm,
257 * the camera device will report the current AF status in android.control.afState
258 * in result metadata.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800259 *
260 * @see CaptureRequest#CONTROL_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700261 * @see #CONTROL_AF_MODE_OFF
262 * @see #CONTROL_AF_MODE_AUTO
263 * @see #CONTROL_AF_MODE_MACRO
264 * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO
265 * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE
266 * @see #CONTROL_AF_MODE_EDOF
267 */
268 public static final Key<Integer> CONTROL_AF_MODE =
269 new Key<Integer>("android.control.afMode", int.class);
270
271 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800272 * <p>List of areas to use for focus
273 * estimation</p>
274 * <p>Each area is a rectangle plus weight: xmin, ymin,
Timothy Knight2629f272013-09-03 17:23:23 -0700275 * xmax, ymax, weight. The rectangle is defined inclusive of the
Igor Murashkinace5bf02013-12-10 17:36:40 -0800276 * specified coordinates.</p>
277 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -0700278 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800279 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
280 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Timothy Knight2629f272013-09-03 17:23:23 -0700281 * bottom-right pixel in the active pixel array. The weight
Igor Murashkinace5bf02013-12-10 17:36:40 -0800282 * should be nonnegative.</p>
283 * <p>If all regions have 0 weight, then no specific focus area
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700284 * needs to be used by the HAL. If the focusing region is
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800285 * outside the current {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, the HAL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700286 * should ignore the sections outside the region and output the
Igor Murashkinace5bf02013-12-10 17:36:40 -0800287 * used sections in the frame metadata</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800288 *
289 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
290 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700291 */
292 public static final Key<int[]> CONTROL_AF_REGIONS =
293 new Key<int[]>("android.control.afRegions", int[].class);
294
295 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800296 * <p>Current state of AF algorithm</p>
297 * <p>Whenever the AF algorithm state changes, a
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700298 * MSG_AUTOFOCUS notification must be send if a notification
Igor Murashkinace5bf02013-12-10 17:36:40 -0800299 * callback is registered.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700300 * @see #CONTROL_AF_STATE_INACTIVE
301 * @see #CONTROL_AF_STATE_PASSIVE_SCAN
302 * @see #CONTROL_AF_STATE_PASSIVE_FOCUSED
303 * @see #CONTROL_AF_STATE_ACTIVE_SCAN
304 * @see #CONTROL_AF_STATE_FOCUSED_LOCKED
305 * @see #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED
Eino-Ville Talvala9f880f72013-09-20 17:50:41 -0700306 * @see #CONTROL_AF_STATE_PASSIVE_UNFOCUSED
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700307 */
308 public static final Key<Integer> CONTROL_AF_STATE =
309 new Key<Integer>("android.control.afState", int.class);
310
311 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800312 * <p>The ID sent with the latest
313 * CAMERA2_TRIGGER_AUTOFOCUS call</p>
314 * <p>Must be 0 if no CAMERA2_TRIGGER_AUTOFOCUS trigger
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700315 * received yet by HAL. Always updated even if AF algorithm
Igor Murashkinace5bf02013-12-10 17:36:40 -0800316 * ignores the trigger</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700317 * @hide
318 */
319 public static final Key<Integer> CONTROL_AF_TRIGGER_ID =
320 new Key<Integer>("android.control.afTriggerId", int.class);
321
322 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800323 * <p>Whether AWB is currently setting the color
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700324 * transform fields, and what its illumination target
Igor Murashkinace5bf02013-12-10 17:36:40 -0800325 * is</p>
Zhijun He399f05d2014-01-15 11:31:30 -0800326 * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is AUTO.</p>
327 * <p>When set to the ON mode, the camera device's auto white balance
328 * routine is enabled, overriding the application's selected
329 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
330 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
331 * <p>When set to the OFF mode, the camera device's auto white balance
332 * routine is disabled. The applicantion manually controls the white
333 * balance by {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, android.colorCorrection.gains
334 * and {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
335 * <p>When set to any other modes, the camera device's auto white balance
336 * routine is disabled. The camera device uses each particular illumination
337 * target for white balance adjustment.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800338 *
Zhijun He399f05d2014-01-15 11:31:30 -0800339 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
Igor Murashkin3242f4f2014-01-15 12:27:41 -0800340 * @see CaptureRequest#COLOR_CORRECTION_MODE
341 * @see CaptureRequest#CONTROL_MODE
Zhijun He399f05d2014-01-15 11:31:30 -0800342 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700343 * @see #CONTROL_AWB_MODE_OFF
344 * @see #CONTROL_AWB_MODE_AUTO
345 * @see #CONTROL_AWB_MODE_INCANDESCENT
346 * @see #CONTROL_AWB_MODE_FLUORESCENT
347 * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT
348 * @see #CONTROL_AWB_MODE_DAYLIGHT
349 * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT
350 * @see #CONTROL_AWB_MODE_TWILIGHT
351 * @see #CONTROL_AWB_MODE_SHADE
352 */
353 public static final Key<Integer> CONTROL_AWB_MODE =
354 new Key<Integer>("android.control.awbMode", int.class);
355
356 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800357 * <p>List of areas to use for illuminant
358 * estimation</p>
359 * <p>Only used in AUTO mode.</p>
360 * <p>Each area is a rectangle plus weight: xmin, ymin,
Timothy Knight2629f272013-09-03 17:23:23 -0700361 * xmax, ymax, weight. The rectangle is defined inclusive of the
Igor Murashkinace5bf02013-12-10 17:36:40 -0800362 * specified coordinates.</p>
363 * <p>The coordinate system is based on the active pixel array,
Timothy Knight2629f272013-09-03 17:23:23 -0700364 * with (0,0) being the top-left pixel in the active pixel array, and
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800365 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
366 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
Timothy Knight2629f272013-09-03 17:23:23 -0700367 * bottom-right pixel in the active pixel array. The weight
Igor Murashkinace5bf02013-12-10 17:36:40 -0800368 * should be nonnegative.</p>
369 * <p>If all regions have 0 weight, then no specific metering area
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700370 * needs to be used by the HAL. If the metering region is
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800371 * outside the current {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, the HAL
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700372 * should ignore the sections outside the region and output the
Igor Murashkinace5bf02013-12-10 17:36:40 -0800373 * used sections in the frame metadata</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800374 *
375 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
376 * @see CaptureRequest#SCALER_CROP_REGION
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700377 */
378 public static final Key<int[]> CONTROL_AWB_REGIONS =
379 new Key<int[]>("android.control.awbRegions", int[].class);
380
381 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800382 * <p>Current state of AWB algorithm</p>
383 * <p>Whenever the AWB algorithm state changes, a
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700384 * MSG_AUTOWHITEBALANCE notification must be send if a
Igor Murashkinace5bf02013-12-10 17:36:40 -0800385 * notification callback is registered.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700386 * @see #CONTROL_AWB_STATE_INACTIVE
387 * @see #CONTROL_AWB_STATE_SEARCHING
388 * @see #CONTROL_AWB_STATE_CONVERGED
389 * @see #CONTROL_AWB_STATE_LOCKED
390 */
391 public static final Key<Integer> CONTROL_AWB_STATE =
392 new Key<Integer>("android.control.awbState", int.class);
393
394 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800395 * <p>Overall mode of 3A control
396 * routines</p>
Zhijun Hef3537422013-12-16 16:56:35 -0800397 * <p>High-level 3A control. When set to OFF, all 3A control
398 * by the HAL is disabled. The application must set the fields for
399 * capture parameters itself.</p>
400 * <p>When set to AUTO, the individual algorithm controls in
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800401 * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p>
Zhijun Hef3537422013-12-16 16:56:35 -0800402 * <p>When set to USE_SCENE_MODE, the individual controls in
403 * android.control.* are mostly disabled, and the HAL implements
404 * one of the scene mode settings (such as ACTION, SUNSET, or PARTY)
405 * as it wishes. The HAL scene mode 3A settings are provided by
406 * android.control.sceneModeOverrides.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800407 *
408 * @see CaptureRequest#CONTROL_AF_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700409 * @see #CONTROL_MODE_OFF
410 * @see #CONTROL_MODE_AUTO
411 * @see #CONTROL_MODE_USE_SCENE_MODE
412 */
413 public static final Key<Integer> CONTROL_MODE =
414 new Key<Integer>("android.control.mode", int.class);
415
416 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800417 * <p>Operation mode for edge
418 * enhancement</p>
Zhijun He28079362013-12-17 10:35:40 -0800419 * <p>Edge/sharpness/detail enhancement. OFF means no
420 * enhancement will be applied by the HAL.</p>
421 * <p>FAST/HIGH_QUALITY both mean HAL-determined enhancement
422 * will be applied. HIGH_QUALITY mode indicates that the
423 * HAL should use the highest-quality enhancement algorithms,
424 * even if it slows down capture rate. FAST means the HAL should
425 * not slow down capture rate when applying edge enhancement.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700426 * @see #EDGE_MODE_OFF
427 * @see #EDGE_MODE_FAST
428 * @see #EDGE_MODE_HIGH_QUALITY
429 */
430 public static final Key<Integer> EDGE_MODE =
431 new Key<Integer>("android.edge.mode", int.class);
432
433 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800434 * <p>Select flash operation mode</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700435 * @see #FLASH_MODE_OFF
436 * @see #FLASH_MODE_SINGLE
437 * @see #FLASH_MODE_TORCH
438 */
439 public static final Key<Integer> FLASH_MODE =
440 new Key<Integer>("android.flash.mode", int.class);
441
442 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800443 * <p>Current state of the flash
444 * unit</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700445 * @see #FLASH_STATE_UNAVAILABLE
446 * @see #FLASH_STATE_CHARGING
447 * @see #FLASH_STATE_READY
448 * @see #FLASH_STATE_FIRED
449 */
450 public static final Key<Integer> FLASH_STATE =
451 new Key<Integer>("android.flash.state", int.class);
452
453 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800454 * <p>GPS coordinates to include in output JPEG
455 * EXIF</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700456 */
457 public static final Key<double[]> JPEG_GPS_COORDINATES =
458 new Key<double[]>("android.jpeg.gpsCoordinates", double[].class);
459
460 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800461 * <p>32 characters describing GPS algorithm to
462 * include in EXIF</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700463 */
464 public static final Key<String> JPEG_GPS_PROCESSING_METHOD =
465 new Key<String>("android.jpeg.gpsProcessingMethod", String.class);
466
467 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800468 * <p>Time GPS fix was made to include in
469 * EXIF</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700470 */
471 public static final Key<Long> JPEG_GPS_TIMESTAMP =
472 new Key<Long>("android.jpeg.gpsTimestamp", long.class);
473
474 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800475 * <p>Orientation of JPEG image to
476 * write</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700477 */
478 public static final Key<Integer> JPEG_ORIENTATION =
479 new Key<Integer>("android.jpeg.orientation", int.class);
480
481 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800482 * <p>Compression quality of the final JPEG
483 * image</p>
484 * <p>85-95 is typical usage range</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700485 */
486 public static final Key<Byte> JPEG_QUALITY =
487 new Key<Byte>("android.jpeg.quality", byte.class);
488
489 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800490 * <p>Compression quality of JPEG
491 * thumbnail</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700492 */
493 public static final Key<Byte> JPEG_THUMBNAIL_QUALITY =
494 new Key<Byte>("android.jpeg.thumbnailQuality", byte.class);
495
496 /**
Zhijun He5a9ff372013-12-26 11:49:09 -0800497 * <p>Resolution of embedded JPEG thumbnail</p>
498 * <p>When set to (0, 0) value, the JPEG EXIF must not contain thumbnail,
499 * but the captured JPEG must still be a valid image.</p>
500 * <p>When a jpeg image capture is issued, the thumbnail size selected should have
501 * the same aspect ratio as the jpeg image.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700502 */
503 public static final Key<android.hardware.camera2.Size> JPEG_THUMBNAIL_SIZE =
504 new Key<android.hardware.camera2.Size>("android.jpeg.thumbnailSize", android.hardware.camera2.Size.class);
505
506 /**
Zhijun Hefb46c642014-01-14 17:57:23 -0800507 * <p>The ratio of lens focal length to the effective
508 * aperture diameter.</p>
509 * <p>This will only be supported on the camera devices that
510 * have variable aperture lens. The aperture value can only be
511 * one of the values listed in {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}.</p>
512 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF,
513 * this can be set along with {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
514 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and android.sensor.frameDuration
515 * to achieve manual exposure control.</p>
516 * <p>The requested aperture value may take several frames to reach the
517 * requested value; the camera device will report the current (intermediate)
518 * aperture size in capture result metadata while the aperture is changing.</p>
519 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of
520 * the ON modes, this will be overridden by the camera device
521 * auto-exposure algorithm, the overridden values are then provided
522 * back to the user in the corresponding result.</p>
523 *
Igor Murashkin3242f4f2014-01-15 12:27:41 -0800524 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
Zhijun He399f05d2014-01-15 11:31:30 -0800525 * @see CaptureRequest#SENSOR_SENSITIVITY
Igor Murashkinaef3b7e2014-01-15 13:20:37 -0800526 * @see CaptureRequest#SENSOR_EXPOSURE_TIME
Zhijun He399f05d2014-01-15 11:31:30 -0800527 * @see CaptureRequest#CONTROL_AE_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700528 */
529 public static final Key<Float> LENS_APERTURE =
530 new Key<Float>("android.lens.aperture", float.class);
531
532 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800533 * <p>State of lens neutral density
534 * filter(s)</p>
535 * <p>Will not be supported on most devices. Can only
536 * pick from supported list</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700537 */
538 public static final Key<Float> LENS_FILTER_DENSITY =
539 new Key<Float>("android.lens.filterDensity", float.class);
540
541 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800542 * <p>Lens optical zoom setting</p>
543 * <p>Will not be supported on most devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700544 */
545 public static final Key<Float> LENS_FOCAL_LENGTH =
546 new Key<Float>("android.lens.focalLength", float.class);
547
548 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800549 * <p>Distance to plane of sharpest focus,
550 * measured from frontmost surface of the lens</p>
551 * <p>Should be zero for fixed-focus cameras</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700552 */
553 public static final Key<Float> LENS_FOCUS_DISTANCE =
554 new Key<Float>("android.lens.focusDistance", float.class);
555
556 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800557 * <p>The range of scene distances that are in
558 * sharp focus (depth of field)</p>
559 * <p>If variable focus not supported, can still report
560 * fixed depth of field range</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700561 */
Zhijun Hec59b0782013-09-26 10:39:36 -0700562 public static final Key<float[]> LENS_FOCUS_RANGE =
563 new Key<float[]>("android.lens.focusRange", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700564
565 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800566 * <p>Whether optical image stabilization is
567 * enabled.</p>
568 * <p>Will not be supported on most devices.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700569 * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF
570 * @see #LENS_OPTICAL_STABILIZATION_MODE_ON
571 */
572 public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE =
573 new Key<Integer>("android.lens.opticalStabilizationMode", int.class);
574
575 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800576 * <p>Current lens status</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700577 * @see #LENS_STATE_STATIONARY
Igor Murashkin9ea4ae62013-09-11 21:40:11 -0700578 * @see #LENS_STATE_MOVING
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700579 */
580 public static final Key<Integer> LENS_STATE =
581 new Key<Integer>("android.lens.state", int.class);
582
583 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800584 * <p>Mode of operation for the noise reduction
585 * algorithm</p>
Zhijun He28079362013-12-17 10:35:40 -0800586 * <p>Noise filtering control. OFF means no noise reduction
587 * will be applied by the HAL.</p>
588 * <p>FAST/HIGH_QUALITY both mean HAL-determined noise filtering
589 * will be applied. HIGH_QUALITY mode indicates that the HAL
590 * should use the highest-quality noise filtering algorithms,
591 * even if it slows down capture rate. FAST means the HAL should not
592 * slow down capture rate when applying noise filtering.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700593 * @see #NOISE_REDUCTION_MODE_OFF
594 * @see #NOISE_REDUCTION_MODE_FAST
595 * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY
596 */
597 public static final Key<Integer> NOISE_REDUCTION_MODE =
598 new Key<Integer>("android.noiseReduction.mode", int.class);
599
600 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800601 * <p>Whether a result given to the framework is the
Eino-Ville Talvala7a313102013-11-07 14:45:06 -0800602 * final one for the capture, or only a partial that contains a
603 * subset of the full set of dynamic metadata
Igor Murashkinace5bf02013-12-10 17:36:40 -0800604 * values.</p>
605 * <p>The entries in the result metadata buffers for a
Eino-Ville Talvala7a313102013-11-07 14:45:06 -0800606 * single capture may not overlap, except for this entry. The
607 * FINAL buffers must retain FIFO ordering relative to the
608 * requests that generate them, so the FINAL buffer for frame 3 must
609 * always be sent to the framework after the FINAL buffer for frame 2, and
610 * before the FINAL buffer for frame 4. PARTIAL buffers may be returned
611 * in any order relative to other frames, but all PARTIAL buffers for a given
612 * capture must arrive before the FINAL buffer for that capture. This entry may
Igor Murashkinace5bf02013-12-10 17:36:40 -0800613 * only be used by the HAL if quirks.usePartialResult is set to 1.</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -0800614 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala7a313102013-11-07 14:45:06 -0800615 * @hide
616 */
617 public static final Key<Boolean> QUIRKS_PARTIAL_RESULT =
618 new Key<Boolean>("android.quirks.partialResult", boolean.class);
619
620 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800621 * <p>A frame counter set by the framework. This value monotonically
Igor Murashkin6bbf9dc2013-09-05 12:22:00 -0700622 * increases with every new result (that is, each new result has a unique
Igor Murashkinace5bf02013-12-10 17:36:40 -0800623 * frameCount value).</p>
624 * <p>Reset on release()</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700625 */
626 public static final Key<Integer> REQUEST_FRAME_COUNT =
627 new Key<Integer>("android.request.frameCount", int.class);
628
629 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800630 * <p>An application-specified ID for the current
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700631 * request. Must be maintained unchanged in output
Igor Murashkinace5bf02013-12-10 17:36:40 -0800632 * frame</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700633 * @hide
634 */
635 public static final Key<Integer> REQUEST_ID =
636 new Key<Integer>("android.request.id", int.class);
637
638 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800639 * <p>(x, y, width, height).</p>
640 * <p>A rectangle with the top-level corner of (x,y) and size
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700641 * (width, height). The region of the sensor that is used for
642 * output. Each stream must use this rectangle to produce its
643 * output, cropping to a smaller region if necessary to
Igor Murashkinace5bf02013-12-10 17:36:40 -0800644 * maintain the stream's aspect ratio.</p>
645 * <p>HAL2.x uses only (x, y, width)</p>
646 * <p>Any additional per-stream cropping must be done to
647 * maximize the final pixel area of the stream.</p>
648 * <p>For example, if the crop region is set to a 4:3 aspect
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700649 * ratio, then 4:3 streams should use the exact crop
650 * region. 16:9 streams should further crop vertically
Igor Murashkinace5bf02013-12-10 17:36:40 -0800651 * (letterbox).</p>
652 * <p>Conversely, if the crop region is set to a 16:9, then 4:3
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700653 * outputs should crop horizontally (pillarbox), and 16:9
654 * streams should match exactly. These additional crops must
Igor Murashkinace5bf02013-12-10 17:36:40 -0800655 * be centered within the crop region.</p>
656 * <p>The output streams must maintain square pixels at all
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700657 * times, no matter what the relative aspect ratios of the
658 * crop region and the stream are. Negative values for
659 * corner are allowed for raw output if full pixel array is
660 * larger than active pixel array. Width and height may be
661 * rounded to nearest larger supportable width, especially
662 * for raw output, where only a few fixed scales may be
663 * possible. The width and height of the crop region cannot
664 * be set to be smaller than floor( activeArraySize.width /
665 * android.scaler.maxDigitalZoom ) and floor(
666 * activeArraySize.height / android.scaler.maxDigitalZoom),
Igor Murashkinace5bf02013-12-10 17:36:40 -0800667 * respectively.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700668 */
669 public static final Key<android.graphics.Rect> SCALER_CROP_REGION =
670 new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class);
671
672 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800673 * <p>Duration each pixel is exposed to
674 * light.</p>
675 * <p>If the sensor can't expose this exact duration, it should shorten the
676 * duration exposed to the nearest possible value (rather than expose longer).</p>
677 * <p>1/10000 - 30 sec range. No bulb mode</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700678 */
679 public static final Key<Long> SENSOR_EXPOSURE_TIME =
680 new Key<Long>("android.sensor.exposureTime", long.class);
681
682 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800683 * <p>Duration from start of frame exposure to
684 * start of next frame exposure</p>
685 * <p>Exposure time has priority, so duration is set to
686 * max(duration, exposure time + overhead)</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700687 */
688 public static final Key<Long> SENSOR_FRAME_DURATION =
689 new Key<Long>("android.sensor.frameDuration", long.class);
690
691 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800692 * <p>Gain applied to image data. Must be
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700693 * implemented through analog gain only if set to values
Igor Murashkinace5bf02013-12-10 17:36:40 -0800694 * below 'maximum analog sensitivity'.</p>
695 * <p>If the sensor can't apply this exact gain, it should lessen the
696 * gain to the nearest possible value (rather than gain more).</p>
697 * <p>ISO 12232:2006 REI method</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700698 */
699 public static final Key<Integer> SENSOR_SENSITIVITY =
700 new Key<Integer>("android.sensor.sensitivity", int.class);
701
702 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800703 * <p>Time at start of exposure of first
704 * row</p>
705 * <p>Monotonic, should be synced to other timestamps in
706 * system</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700707 */
708 public static final Key<Long> SENSOR_TIMESTAMP =
709 new Key<Long>("android.sensor.timestamp", long.class);
710
711 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800712 * <p>The temperature of the sensor, sampled at the time
713 * exposure began for this frame.</p>
714 * <p>The thermal diode being queried should be inside the sensor PCB, or
715 * somewhere close to it.</p>
Igor Murashkin3242f4f2014-01-15 12:27:41 -0800716 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
717 * <p><b>Full capability</b> -
718 * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
719 * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
720 *
721 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
Igor Murashkind5ff06a2013-08-20 15:15:06 -0700722 */
723 public static final Key<Float> SENSOR_TEMPERATURE =
724 new Key<Float>("android.sensor.temperature", float.class);
725
726 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800727 * <p>State of the face detector
728 * unit</p>
729 * <p>Whether face detection is enabled, and whether it
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700730 * should output just the basic fields or the full set of
731 * fields. Value must be one of the
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800732 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}.</p>
733 *
734 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700735 * @see #STATISTICS_FACE_DETECT_MODE_OFF
736 * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE
737 * @see #STATISTICS_FACE_DETECT_MODE_FULL
738 */
739 public static final Key<Integer> STATISTICS_FACE_DETECT_MODE =
740 new Key<Integer>("android.statistics.faceDetectMode", int.class);
741
742 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800743 * <p>List of unique IDs for detected
744 * faces</p>
745 * <p>Only available if faceDetectMode == FULL</p>
Zhijun He7f80d6f2013-11-04 10:18:05 -0800746 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700747 */
748 public static final Key<int[]> STATISTICS_FACE_IDS =
749 new Key<int[]>("android.statistics.faceIds", int[].class);
750
751 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800752 * <p>List of landmarks for detected
753 * faces</p>
754 * <p>Only available if faceDetectMode == FULL</p>
Zhijun He7f80d6f2013-11-04 10:18:05 -0800755 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700756 */
757 public static final Key<int[]> STATISTICS_FACE_LANDMARKS =
758 new Key<int[]>("android.statistics.faceLandmarks", int[].class);
759
760 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800761 * <p>List of the bounding rectangles for detected
762 * faces</p>
763 * <p>Only available if faceDetectMode != OFF</p>
Zhijun He7f80d6f2013-11-04 10:18:05 -0800764 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700765 */
766 public static final Key<android.graphics.Rect[]> STATISTICS_FACE_RECTANGLES =
767 new Key<android.graphics.Rect[]>("android.statistics.faceRectangles", android.graphics.Rect[].class);
768
769 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800770 * <p>List of the face confidence scores for
771 * detected faces</p>
772 * <p>Only available if faceDetectMode != OFF. The value should be
773 * meaningful (for example, setting 100 at all times is illegal).</p>
Zhijun He7f80d6f2013-11-04 10:18:05 -0800774 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700775 */
776 public static final Key<byte[]> STATISTICS_FACE_SCORES =
777 new Key<byte[]>("android.statistics.faceScores", byte[].class);
778
779 /**
Igor Murashkin7a9b30e2013-12-11 13:31:38 -0800780 * <p>The shading map is a low-resolution floating-point map
781 * that lists the coefficients used to correct for vignetting, for each
782 * Bayer color channel.</p>
783 * <p>The least shaded section of the image should have a gain factor
784 * of 1; all other sections should have gains above 1.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800785 * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map
Igor Murashkinace5bf02013-12-10 17:36:40 -0800786 * must take into account the colorCorrection settings.</p>
Igor Murashkin7a9b30e2013-12-11 13:31:38 -0800787 * <p>The shading map is for the entire active pixel array, and is not
788 * affected by the crop region specified in the request. Each shading map
789 * entry is the value of the shading compensation map over a specific
790 * pixel on the sensor. Specifically, with a (N x M) resolution shading
791 * map, and an active pixel array size (W x H), shading map entry
792 * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at
793 * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
794 * The map is assumed to be bilinearly interpolated between the sample points.</p>
795 * <p>The channel order is [R, Geven, Godd, B], where Geven is the green
796 * channel for the even rows of a Bayer pattern, and Godd is the odd rows.
797 * The shading map is stored in a fully interleaved format, and its size
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800798 * is provided in the camera static metadata by {@link CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE android.lens.info.shadingMapSize}.</p>
Igor Murashkin7a9b30e2013-12-11 13:31:38 -0800799 * <p>The shading map should have on the order of 30-40 rows and columns,
800 * and must be smaller than 64x64.</p>
801 * <p>As an example, given a very small map defined as:</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800802 * <pre><code>{@link CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE android.lens.info.shadingMapSize} = [ 4, 3 ]
803 * {@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap} =
Igor Murashkin7a9b30e2013-12-11 13:31:38 -0800804 * [ 1.3, 1.2, 1.15, 1.2, 1.2, 1.2, 1.15, 1.2,
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800805 * 1.1, 1.2, 1.2, 1.2, 1.3, 1.2, 1.3, 1.3,
806 * 1.2, 1.2, 1.25, 1.1, 1.1, 1.1, 1.1, 1.0,
807 * 1.0, 1.0, 1.0, 1.0, 1.2, 1.3, 1.25, 1.2,
808 * 1.3, 1.2, 1.2, 1.3, 1.2, 1.15, 1.1, 1.2,
809 * 1.2, 1.1, 1.0, 1.2, 1.3, 1.15, 1.2, 1.3 ]
Igor Murashkin7a9b30e2013-12-11 13:31:38 -0800810 * </code></pre>
811 * <p>The low-resolution scaling map images for each channel are
812 * (displayed using nearest-neighbor interpolation):</p>
813 * <p><img alt="Red lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" />
814 * <img alt="Green (even rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" />
815 * <img alt="Green (odd rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" />
816 * <img alt="Blue lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/blue_shading.png" /></p>
817 * <p>As a visualization only, inverting the full-color map to recover an
818 * image of a gray wall (using bicubic interpolation for visual quality) as captured by the sensor gives:</p>
819 * <p><img alt="Image of a uniform white wall (inverse shading map)" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/inv_shading.png" /></p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800820 *
Zhijun Hefb46c642014-01-14 17:57:23 -0800821 * @see CaptureRequest#COLOR_CORRECTION_MODE
Igor Murashkin3242f4f2014-01-15 12:27:41 -0800822 * @see CaptureResult#STATISTICS_LENS_SHADING_MAP
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800823 * @see CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700824 */
825 public static final Key<float[]> STATISTICS_LENS_SHADING_MAP =
826 new Key<float[]>("android.statistics.lensShadingMap", float[].class);
827
828 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800829 * <p>The best-fit color channel gains calculated
830 * by the HAL's statistics units for the current output frame</p>
831 * <p>This may be different than the gains used for this frame,
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700832 * since statistics processing on data from a new frame
833 * typically completes after the transform has already been
Igor Murashkinace5bf02013-12-10 17:36:40 -0800834 * applied to that frame.</p>
835 * <p>The 4 channel gains are defined in Bayer domain,
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800836 * see {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} for details.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -0800837 * <p>This value should always be calculated by the AWB block,
838 * regardless of the android.control.* current values.</p>
Igor Murashkinaef3b7e2014-01-15 13:20:37 -0800839 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800840 *
841 * @see CaptureRequest#COLOR_CORRECTION_GAINS
Igor Murashkinaef3b7e2014-01-15 13:20:37 -0800842 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700843 */
844 public static final Key<float[]> STATISTICS_PREDICTED_COLOR_GAINS =
845 new Key<float[]>("android.statistics.predictedColorGains", float[].class);
846
847 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800848 * <p>The best-fit color transform matrix estimate
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700849 * calculated by the HAL's statistics units for the current
Igor Murashkinace5bf02013-12-10 17:36:40 -0800850 * output frame</p>
851 * <p>The HAL must provide the estimate from its
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700852 * statistics unit on the white balance transforms to use
853 * for the next frame. These are the values the HAL believes
854 * are the best fit for the current output frame. This may
855 * be different than the transform used for this frame, since
856 * statistics processing on data from a new frame typically
857 * completes after the transform has already been applied to
Igor Murashkinace5bf02013-12-10 17:36:40 -0800858 * that frame.</p>
859 * <p>These estimates must be provided for all frames, even if
860 * capture settings and color transforms are set by the application.</p>
861 * <p>This value should always be calculated by the AWB block,
862 * regardless of the android.control.* current values.</p>
Igor Murashkinaef3b7e2014-01-15 13:20:37 -0800863 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
864 * @hide
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700865 */
866 public static final Key<Rational[]> STATISTICS_PREDICTED_COLOR_TRANSFORM =
867 new Key<Rational[]>("android.statistics.predictedColorTransform", Rational[].class);
868
869 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800870 * <p>The HAL estimated scene illumination lighting
871 * frequency</p>
872 * <p>Report NONE if there doesn't appear to be flickering
873 * illumination</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700874 * @see #STATISTICS_SCENE_FLICKER_NONE
875 * @see #STATISTICS_SCENE_FLICKER_50HZ
876 * @see #STATISTICS_SCENE_FLICKER_60HZ
877 */
878 public static final Key<Integer> STATISTICS_SCENE_FLICKER =
879 new Key<Integer>("android.statistics.sceneFlicker", int.class);
880
881 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800882 * <p>Table mapping blue input values to output
883 * values</p>
884 * <p>Tonemapping / contrast / gamma curve for the blue
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800885 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is CONTRAST_CURVE.</p>
886 * <p>See {@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} for more details.</p>
887 *
Zhijun Hefb46c642014-01-14 17:57:23 -0800888 * @see CaptureRequest#TONEMAP_MODE
Igor Murashkin3242f4f2014-01-15 12:27:41 -0800889 * @see CaptureRequest#TONEMAP_CURVE_RED
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700890 */
Zhijun He3ffd7052013-08-19 15:45:08 -0700891 public static final Key<float[]> TONEMAP_CURVE_BLUE =
892 new Key<float[]>("android.tonemap.curveBlue", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700893
894 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800895 * <p>Table mapping green input values to output
896 * values</p>
897 * <p>Tonemapping / contrast / gamma curve for the green
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800898 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is CONTRAST_CURVE.</p>
899 * <p>See {@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} for more details.</p>
900 *
Zhijun Hefb46c642014-01-14 17:57:23 -0800901 * @see CaptureRequest#TONEMAP_MODE
Igor Murashkin3242f4f2014-01-15 12:27:41 -0800902 * @see CaptureRequest#TONEMAP_CURVE_RED
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700903 */
Zhijun He3ffd7052013-08-19 15:45:08 -0700904 public static final Key<float[]> TONEMAP_CURVE_GREEN =
905 new Key<float[]>("android.tonemap.curveGreen", float[].class);
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700906
907 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800908 * <p>Table mapping red input values to output
909 * values</p>
910 * <p>Tonemapping / contrast / gamma curve for the red
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800911 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is CONTRAST_CURVE.</p>
Igor Murashkinace5bf02013-12-10 17:36:40 -0800912 * <p>Since the input and output ranges may vary depending on
Zhijun He3ffd7052013-08-19 15:45:08 -0700913 * the camera pipeline, the input and output pixel values
914 * are represented by normalized floating-point values
Igor Murashkinace5bf02013-12-10 17:36:40 -0800915 * between 0 and 1, with 0 == black and 1 == white.</p>
916 * <p>The curve should be linearly interpolated between the
Zhijun He3ffd7052013-08-19 15:45:08 -0700917 * defined points. The points will be listed in increasing
918 * order of P_IN. For example, if the array is: [0.0, 0.0,
Igor Murashkinace5bf02013-12-10 17:36:40 -0800919 * 0.3, 0.5, 1.0, 1.0], then the input-&gt;output mapping
920 * for a few sample points would be: 0 -&gt; 0, 0.15 -&gt;
921 * 0.25, 0.3 -&gt; 0.5, 0.5 -&gt; 0.64</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800922 *
923 * @see CaptureRequest#TONEMAP_MODE
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700924 */
925 public static final Key<float[]> TONEMAP_CURVE_RED =
926 new Key<float[]>("android.tonemap.curveRed", float[].class);
927
928 /**
Igor Murashkin3242f4f2014-01-15 12:27:41 -0800929 *
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700930 * @see #TONEMAP_MODE_CONTRAST_CURVE
931 * @see #TONEMAP_MODE_FAST
932 * @see #TONEMAP_MODE_HIGH_QUALITY
933 */
934 public static final Key<Integer> TONEMAP_MODE =
935 new Key<Integer>("android.tonemap.mode", int.class);
936
937 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800938 * <p>This LED is nominally used to indicate to the user
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700939 * that the camera is powered on and may be streaming images back to the
940 * Application Processor. In certain rare circumstances, the OS may
941 * disable this when video is processed locally and not transmitted to
Igor Murashkinace5bf02013-12-10 17:36:40 -0800942 * any untrusted applications.</p>
943 * <p>In particular, the LED <em>must</em> always be on when the data could be
944 * transmitted off the device. The LED <em>should</em> always be on whenever
945 * data is stored locally on the device.</p>
946 * <p>The LED <em>may</em> be off if a trusted application is using the data that
947 * doesn't violate the above rules.</p>
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700948 * @hide
949 */
950 public static final Key<Boolean> LED_TRANSMIT =
951 new Key<Boolean>("android.led.transmit", boolean.class);
952
953 /**
Igor Murashkinace5bf02013-12-10 17:36:40 -0800954 * <p>Whether black-level compensation is locked
Eino-Ville Talvala0956af52013-12-26 13:19:10 -0800955 * to its current values, or is free to vary.</p>
956 * <p>Whether the black level offset was locked for this frame. Should be
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800957 * ON if {@link CaptureRequest#BLACK_LEVEL_LOCK android.blackLevel.lock} was ON in the capture request, unless
Eino-Ville Talvala0956af52013-12-26 13:19:10 -0800958 * a change in other capture settings forced the camera device to
959 * perform a black level reset.</p>
Eino-Ville Talvala0da8bf52014-01-08 16:18:35 -0800960 *
961 * @see CaptureRequest#BLACK_LEVEL_LOCK
Eino-Ville Talvala5a32b20c2013-08-08 12:38:36 -0700962 */
963 public static final Key<Boolean> BLACK_LEVEL_LOCK =
964 new Key<Boolean>("android.blackLevel.lock", boolean.class);
965
966 /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
967 * End generated code
968 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
Igor Murashkinb779ac12013-09-05 12:40:19 -0700969
970 /**
971 * <p>
972 * List of the {@link Face Faces} detected through camera face detection
973 * in this result.
974 * </p>
975 * <p>
976 * Only available if {@link #STATISTICS_FACE_DETECT_MODE} {@code !=}
977 * {@link CameraMetadata#STATISTICS_FACE_DETECT_MODE_OFF OFF}.
978 * </p>
979 *
980 * @see Face
981 */
982 public static final Key<Face[]> STATISTICS_FACES =
983 new Key<Face[]>("android.statistics.faces", Face[].class);
Eino-Ville Talvalab2675542012-12-12 13:29:45 -0800984}