CaptureRequest.java revision e4aa2831ce6a07a6454ebd61675d9ac432f8f492
1b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala/*
2b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala * Copyright (C) 2013 The Android Open Source Project
3b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala *
4b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala * Licensed under the Apache License, Version 2.0 (the "License");
5b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala * you may not use this file except in compliance with the License.
6b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala * You may obtain a copy of the License at
7b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala *
8b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala *      http://www.apache.org/licenses/LICENSE-2.0
9b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala *
10b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala * Unless required by applicable law or agreed to in writing, software
11b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala * distributed under the License is distributed on an "AS IS" BASIS,
12b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala * See the License for the specific language governing permissions and
14b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala * limitations under the License.
15b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala */
16b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala
172f1a2e423e0fbb64467d6fcfa4e82c6384f31210Eino-Ville Talvalapackage android.hardware.camera2;
18b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala
1970c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvalaimport android.hardware.camera2.impl.CameraMetadataNative;
206c76f58f31635c19c14ae161f96dad2082537860Igor Murashkinimport android.hardware.camera2.impl.PublicKey;
216c76f58f31635c19c14ae161f96dad2082537860Igor Murashkinimport android.hardware.camera2.impl.SyntheticKey;
225776aafc7e70c0b79c4bee2bc50f44121b37c962Ruben Brunkimport android.hardware.camera2.utils.HashCodeHelpers;
23d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkinimport android.hardware.camera2.utils.TypeReference;
2470725500dcf3b666b43d50563d64705aab58d2d3Igor Murashkinimport android.os.Parcel;
2570725500dcf3b666b43d50563d64705aab58d2d3Igor Murashkinimport android.os.Parcelable;
26b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvalaimport android.view.Surface;
27b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala
28feb50af361e4305a25758966b6b5df2738c00259Ruben Brunkimport java.util.Collection;
29feb50af361e4305a25758966b6b5df2738c00259Ruben Brunkimport java.util.Collections;
3070725500dcf3b666b43d50563d64705aab58d2d3Igor Murashkinimport java.util.HashSet;
31d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkinimport java.util.List;
326bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkinimport java.util.Objects;
33b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala
34b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala
35b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala/**
3670c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala * <p>An immutable package of settings and outputs needed to capture a single
3770c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala * image from the camera device.</p>
38b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala *
39b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala * <p>Contains the configuration for the capture hardware (sensor, lens, flash),
4070c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala * the processing pipeline, the control algorithms, and the output buffers. Also
4170c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala * contains the list of target Surfaces to send image data to for this
4270c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala * capture.</p>
43b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala *
4470c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala * <p>CaptureRequests can be created by using a {@link Builder} instance,
4570c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala * obtained by calling {@link CameraDevice#createCaptureRequest}</p>
46b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala *
47b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala * <p>CaptureRequests are given to {@link CameraCaptureSession#capture} or
48b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala * {@link CameraCaptureSession#setRepeatingRequest} to capture images from a camera.</p>
49b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala *
50b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala * <p>Each request can specify a different subset of target Surfaces for the
51b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala * camera to send the captured data to. All the surfaces used in a request must
52b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala * be part of the surface list given to the last call to
53b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala * {@link CameraDevice#createCaptureSession}, when the request is submitted to the
54b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala * session.</p>
55b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala *
56b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala * <p>For example, a request meant for repeating preview might only include the
57b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala * Surface for the preview SurfaceView or SurfaceTexture, while a
58b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala * high-resolution still capture would also include a Surface from a ImageReader
59b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala * configured for high-resolution JPEG images.</p>
60b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala *
61b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala * @see CameraDevice#capture
62b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala * @see CameraDevice#setRepeatingRequest
6370c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala * @see CameraDevice#createCaptureRequest
64b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala */
65d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkinpublic final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>>
66d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        implements Parcelable {
67d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin
68d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    /**
69d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * A {@code Key} is used to do capture request field lookups with
70d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * {@link CaptureResult#get} or to set fields with
71d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * {@link CaptureRequest.Builder#set(Key, Object)}.
72d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     *
73d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * <p>For example, to set the crop rectangle for the next capture:
74d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * <code><pre>
75d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * Rect cropRectangle = new Rect(0, 0, 640, 480);
76d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * captureRequestBuilder.set(SCALER_CROP_REGION, cropRectangle);
77d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * </pre></code>
78d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * </p>
79d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     *
80d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * <p>To enumerate over all possible keys for {@link CaptureResult}, see
81d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * {@link CameraCharacteristics#getAvailableCaptureResultKeys}.</p>
82d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     *
83d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * @see CaptureResult#get
84d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * @see CameraCharacteristics#getAvailableCaptureResultKeys
85d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     */
86d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    public final static class Key<T> {
87d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        private final CameraMetadataNative.Key<T> mKey;
88d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin
89d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        /**
90d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         * Visible for testing and vendor extensions only.
91d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         *
92d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         * @hide
93d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         */
94d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        public Key(String name, Class<T> type) {
95d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin            mKey = new CameraMetadataNative.Key<T>(name, type);
96d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        }
97d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin
98d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        /**
99d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         * Visible for testing and vendor extensions only.
100d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         *
101d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         * @hide
102d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         */
103d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        public Key(String name, TypeReference<T> typeReference) {
104d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin            mKey = new CameraMetadataNative.Key<T>(name, typeReference);
105d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        }
106d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin
107d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        /**
108d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         * Return a camelCase, period separated name formatted like:
109d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         * {@code "root.section[.subsections].name"}.
110d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         *
111d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         * <p>Built-in keys exposed by the Android SDK are always prefixed with {@code "android."};
112d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         * keys that are device/platform-specific are prefixed with {@code "com."}.</p>
113d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         *
114d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         * <p>For example, {@code CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP} would
115d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         * have a name of {@code "android.scaler.streamConfigurationMap"}; whereas a device
116d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         * specific key might look like {@code "com.google.nexus.data.private"}.</p>
117d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         *
118d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         * @return String representation of the key name
119d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         */
120d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        public String getName() {
121d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin            return mKey.getName();
122d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        }
123d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin
124d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        /**
125d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         * {@inheritDoc}
126d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         */
127d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        @Override
128d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        public final int hashCode() {
129d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin            return mKey.hashCode();
130d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        }
131d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin
132d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        /**
133d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         * {@inheritDoc}
134d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         */
135d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        @SuppressWarnings("unchecked")
136d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        @Override
137d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        public final boolean equals(Object o) {
138d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin            return o instanceof Key && ((Key<T>)o).mKey.equals(mKey);
139d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        }
140d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin
141d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        /**
142d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         * Visible for CameraMetadataNative implementation only; do not use.
143d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         *
144d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         * TODO: Make this private or remove it altogether.
145d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         *
146d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         * @hide
147d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         */
148d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        public CameraMetadataNative.Key<T> getNativeKey() {
149d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin            return mKey;
150d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        }
151d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin
152d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        @SuppressWarnings({ "unchecked" })
153d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        /*package*/ Key(CameraMetadataNative.Key<?> nativeKey) {
154d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin            mKey = (CameraMetadataNative.Key<T>) nativeKey;
155d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        }
156d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    }
15770725500dcf3b666b43d50563d64705aab58d2d3Igor Murashkin
15870c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala    private final HashSet<Surface> mSurfaceSet;
15970c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala    private final CameraMetadataNative mSettings;
16070c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala
1614068388beea728bbf9f321b0b5b5c52ce4ab3d06Eino-Ville Talvala    private Object mUserTag;
162b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala
163b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala    /**
1646bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     * Construct empty request.
1656bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     *
1666bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     * Used by Binder to unparcel this object only.
16770725500dcf3b666b43d50563d64705aab58d2d3Igor Murashkin     */
1686bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin    private CaptureRequest() {
16970c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala        mSettings = new CameraMetadataNative();
17070c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala        mSurfaceSet = new HashSet<Surface>();
171b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala    }
172b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala
173b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala    /**
1746bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     * Clone from source capture request.
1756bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     *
1766bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     * Used by the Builder to create an immutable copy.
177b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala     */
1786bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin    @SuppressWarnings("unchecked")
17970c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala    private CaptureRequest(CaptureRequest source) {
18070c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala        mSettings = new CameraMetadataNative(source.mSettings);
18170c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala        mSurfaceSet = (HashSet<Surface>) source.mSurfaceSet.clone();
1827b01c5c4d27ebbd739d9e5e0de7eaafbffd8e084Eino-Ville Talvala        mUserTag = source.mUserTag;
183b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala    }
184b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala
185b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala    /**
1866bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     * Take ownership of passed-in settings.
1876bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     *
1886bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     * Used by the Builder to create a mutable CaptureRequest.
189b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala     */
19070c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala    private CaptureRequest(CameraMetadataNative settings) {
191d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        mSettings = CameraMetadataNative.move(settings);
19270c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala        mSurfaceSet = new HashSet<Surface>();
19370725500dcf3b666b43d50563d64705aab58d2d3Igor Murashkin    }
19470725500dcf3b666b43d50563d64705aab58d2d3Igor Murashkin
195d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    /**
196d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * Get a capture request field value.
197d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     *
198d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * <p>The field definitions can be found in {@link CaptureRequest}.</p>
199d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     *
200d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * <p>Querying the value for the same key more than once will return a value
201d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * which is equal to the previous queried value.</p>
202d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     *
203d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * @throws IllegalArgumentException if the key was not valid
204d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     *
205d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * @param key The result field to read.
206d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * @return The value of that key, or {@code null} if the field is not set.
207d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     */
20870c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala    public <T> T get(Key<T> key) {
20970c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala        return mSettings.get(key);
2104068388beea728bbf9f321b0b5b5c52ce4ab3d06Eino-Ville Talvala    }
2114068388beea728bbf9f321b0b5b5c52ce4ab3d06Eino-Ville Talvala
2124068388beea728bbf9f321b0b5b5c52ce4ab3d06Eino-Ville Talvala    /**
213d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * {@inheritDoc}
214d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * @hide
215d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     */
216d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    @SuppressWarnings("unchecked")
217d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    @Override
218d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    protected <T> T getProtected(Key<?> key) {
219d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        return (T) mSettings.get(key);
220d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    }
221d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin
222d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    /**
223d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * {@inheritDoc}
224d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * @hide
225d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     */
226d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    @SuppressWarnings("unchecked")
227d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    @Override
228d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    protected Class<Key<?>> getKeyClass() {
229d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        Object thisClass = Key.class;
230d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        return (Class<Key<?>>)thisClass;
231d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    }
232d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin
233d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    /**
234d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * {@inheritDoc}
235d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     */
236d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    @Override
237d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    public List<Key<?>> getKeys() {
238d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        // Force the javadoc for this function to show up on the CaptureRequest page
239d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        return super.getKeys();
240d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    }
241d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin
242d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    /**
2434068388beea728bbf9f321b0b5b5c52ce4ab3d06Eino-Ville Talvala     * Retrieve the tag for this request, if any.
2444068388beea728bbf9f321b0b5b5c52ce4ab3d06Eino-Ville Talvala     *
2454068388beea728bbf9f321b0b5b5c52ce4ab3d06Eino-Ville Talvala     * <p>This tag is not used for anything by the camera device, but can be
2464068388beea728bbf9f321b0b5b5c52ce4ab3d06Eino-Ville Talvala     * used by an application to easily identify a CaptureRequest when it is
2474068388beea728bbf9f321b0b5b5c52ce4ab3d06Eino-Ville Talvala     * returned by
248fd887436bd111e4d2c7307578a51b5070025b7f2Eino-Ville Talvala     * {@link CameraCaptureSession.CaptureCallback#onCaptureCompleted CaptureCallback.onCaptureCompleted}
2494068388beea728bbf9f321b0b5b5c52ce4ab3d06Eino-Ville Talvala     * </p>
2504068388beea728bbf9f321b0b5b5c52ce4ab3d06Eino-Ville Talvala     *
2514068388beea728bbf9f321b0b5b5c52ce4ab3d06Eino-Ville Talvala     * @return the last tag Object set on this request, or {@code null} if
2524068388beea728bbf9f321b0b5b5c52ce4ab3d06Eino-Ville Talvala     *     no tag has been set.
25370c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala     * @see Builder#setTag
2544068388beea728bbf9f321b0b5b5c52ce4ab3d06Eino-Ville Talvala     */
2554068388beea728bbf9f321b0b5b5c52ce4ab3d06Eino-Ville Talvala    public Object getTag() {
25670c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala        return mUserTag;
2574068388beea728bbf9f321b0b5b5c52ce4ab3d06Eino-Ville Talvala    }
2584068388beea728bbf9f321b0b5b5c52ce4ab3d06Eino-Ville Talvala
2596bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin    /**
2606bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     * Determine whether this CaptureRequest is equal to another CaptureRequest.
2616bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     *
2626bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     * <p>A request is considered equal to another is if it's set of key/values is equal, it's
2636bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     * list of output surfaces is equal, and the user tag is equal.</p>
2646bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     *
2656bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     * @param other Another instance of CaptureRequest.
2666bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     *
2676bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     * @return True if the requests are the same, false otherwise.
2686bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     */
2696bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin    @Override
2706bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin    public boolean equals(Object other) {
2716bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin        return other instanceof CaptureRequest
2726bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin                && equals((CaptureRequest)other);
2736bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin    }
2746bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin
2756bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin    private boolean equals(CaptureRequest other) {
2766bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin        return other != null
2776bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin                && Objects.equals(mUserTag, other.mUserTag)
2786bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin                && mSurfaceSet.equals(other.mSurfaceSet)
2796bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin                && mSettings.equals(other.mSettings);
2806bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin    }
2816bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin
2826bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin    @Override
2836bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin    public int hashCode() {
2845776aafc7e70c0b79c4bee2bc50f44121b37c962Ruben Brunk        return HashCodeHelpers.hashCode(mSettings, mSurfaceSet, mUserTag);
2856bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin    }
2866bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin
28770725500dcf3b666b43d50563d64705aab58d2d3Igor Murashkin    public static final Parcelable.Creator<CaptureRequest> CREATOR =
28870725500dcf3b666b43d50563d64705aab58d2d3Igor Murashkin            new Parcelable.Creator<CaptureRequest>() {
28970725500dcf3b666b43d50563d64705aab58d2d3Igor Murashkin        @Override
29070725500dcf3b666b43d50563d64705aab58d2d3Igor Murashkin        public CaptureRequest createFromParcel(Parcel in) {
29170725500dcf3b666b43d50563d64705aab58d2d3Igor Murashkin            CaptureRequest request = new CaptureRequest();
29270725500dcf3b666b43d50563d64705aab58d2d3Igor Murashkin            request.readFromParcel(in);
29370c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala
29470725500dcf3b666b43d50563d64705aab58d2d3Igor Murashkin            return request;
29570725500dcf3b666b43d50563d64705aab58d2d3Igor Murashkin        }
29670725500dcf3b666b43d50563d64705aab58d2d3Igor Murashkin
29770725500dcf3b666b43d50563d64705aab58d2d3Igor Murashkin        @Override
29870725500dcf3b666b43d50563d64705aab58d2d3Igor Murashkin        public CaptureRequest[] newArray(int size) {
29970725500dcf3b666b43d50563d64705aab58d2d3Igor Murashkin            return new CaptureRequest[size];
30070725500dcf3b666b43d50563d64705aab58d2d3Igor Murashkin        }
30170725500dcf3b666b43d50563d64705aab58d2d3Igor Murashkin    };
30270725500dcf3b666b43d50563d64705aab58d2d3Igor Murashkin
30370725500dcf3b666b43d50563d64705aab58d2d3Igor Murashkin    /**
30470725500dcf3b666b43d50563d64705aab58d2d3Igor Murashkin     * Expand this object from a Parcel.
30570c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala     * Hidden since this breaks the immutability of CaptureRequest, but is
30670c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala     * needed to receive CaptureRequests with aidl.
30770c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala     *
30870725500dcf3b666b43d50563d64705aab58d2d3Igor Murashkin     * @param in The parcel from which the object should be read
30970c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala     * @hide
31070725500dcf3b666b43d50563d64705aab58d2d3Igor Murashkin     */
31172f9f0a96e4476ef231d5001cb30521ad4ce5b1eIgor Murashkin    private void readFromParcel(Parcel in) {
31270c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala        mSettings.readFromParcel(in);
31370725500dcf3b666b43d50563d64705aab58d2d3Igor Murashkin
31470c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala        mSurfaceSet.clear();
31570725500dcf3b666b43d50563d64705aab58d2d3Igor Murashkin
31670c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala        Parcelable[] parcelableArray = in.readParcelableArray(Surface.class.getClassLoader());
31770725500dcf3b666b43d50563d64705aab58d2d3Igor Murashkin
31870c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala        if (parcelableArray == null) {
31970c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala            return;
32070c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala        }
32170725500dcf3b666b43d50563d64705aab58d2d3Igor Murashkin
32270c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala        for (Parcelable p : parcelableArray) {
32370c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala            Surface s = (Surface) p;
32470c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala            mSurfaceSet.add(s);
32570725500dcf3b666b43d50563d64705aab58d2d3Igor Murashkin        }
32670725500dcf3b666b43d50563d64705aab58d2d3Igor Murashkin    }
32770725500dcf3b666b43d50563d64705aab58d2d3Igor Murashkin
32870725500dcf3b666b43d50563d64705aab58d2d3Igor Murashkin    @Override
32970c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala    public int describeContents() {
33070c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala        return 0;
33170c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala    }
33270c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala
33370c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala    @Override
33470725500dcf3b666b43d50563d64705aab58d2d3Igor Murashkin    public void writeToParcel(Parcel dest, int flags) {
33570c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala        mSettings.writeToParcel(dest, flags);
33670c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala        dest.writeParcelableArray(mSurfaceSet.toArray(new Surface[mSurfaceSet.size()]), flags);
33770c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala    }
33870c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala
33970c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala    /**
340feb50af361e4305a25758966b6b5df2738c00259Ruben Brunk     * @hide
341feb50af361e4305a25758966b6b5df2738c00259Ruben Brunk     */
342feb50af361e4305a25758966b6b5df2738c00259Ruben Brunk    public boolean containsTarget(Surface surface) {
343feb50af361e4305a25758966b6b5df2738c00259Ruben Brunk        return mSurfaceSet.contains(surface);
344feb50af361e4305a25758966b6b5df2738c00259Ruben Brunk    }
345feb50af361e4305a25758966b6b5df2738c00259Ruben Brunk
346feb50af361e4305a25758966b6b5df2738c00259Ruben Brunk    /**
347feb50af361e4305a25758966b6b5df2738c00259Ruben Brunk     * @hide
348feb50af361e4305a25758966b6b5df2738c00259Ruben Brunk     */
349feb50af361e4305a25758966b6b5df2738c00259Ruben Brunk    public Collection<Surface> getTargets() {
350feb50af361e4305a25758966b6b5df2738c00259Ruben Brunk        return Collections.unmodifiableCollection(mSurfaceSet);
351feb50af361e4305a25758966b6b5df2738c00259Ruben Brunk    }
352feb50af361e4305a25758966b6b5df2738c00259Ruben Brunk
353feb50af361e4305a25758966b6b5df2738c00259Ruben Brunk    /**
35470c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala     * A builder for capture requests.
35570c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala     *
35670c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala     * <p>To obtain a builder instance, use the
35770c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala     * {@link CameraDevice#createCaptureRequest} method, which initializes the
35870c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala     * request fields to one of the templates defined in {@link CameraDevice}.
35970c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala     *
36070c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala     * @see CameraDevice#createCaptureRequest
361b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * @see CameraDevice#TEMPLATE_PREVIEW
362b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * @see CameraDevice#TEMPLATE_RECORD
363b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * @see CameraDevice#TEMPLATE_STILL_CAPTURE
364b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * @see CameraDevice#TEMPLATE_VIDEO_SNAPSHOT
365b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * @see CameraDevice#TEMPLATE_MANUAL
36670c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala     */
36770c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala    public final static class Builder {
36870c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala
3697a36a0fbb0a5f14047a3680668da954beca05dcbIgor Murashkin        private final CaptureRequest mRequest;
37070c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala
37170c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala        /**
37270c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         * Initialize the builder using the template; the request takes
37370c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         * ownership of the template.
37470c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         *
37570c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         * @hide
37670c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         */
37770c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala        public Builder(CameraMetadataNative template) {
37870c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala            mRequest = new CaptureRequest(template);
37970c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala        }
38070c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala
38170c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala        /**
38270c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         * <p>Add a surface to the list of targets for this request</p>
38370c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         *
38470c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         * <p>The Surface added must be one of the surfaces included in the most
385b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala         * recent call to {@link CameraDevice#createCaptureSession}, when the
38670c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         * request is given to the camera device.</p>
38770c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         *
38870c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         * <p>Adding a target more than once has no effect.</p>
38970c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         *
39070c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         * @param outputTarget Surface to use as an output target for this request
39170c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         */
39270c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala        public void addTarget(Surface outputTarget) {
39370c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala            mRequest.mSurfaceSet.add(outputTarget);
39470c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala        }
39570725500dcf3b666b43d50563d64705aab58d2d3Igor Murashkin
39670c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala        /**
39770c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         * <p>Remove a surface from the list of targets for this request.</p>
39870c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         *
39970c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         * <p>Removing a target that is not currently added has no effect.</p>
40070c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         *
40170c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         * @param outputTarget Surface to use as an output target for this request
40270c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         */
40370c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala        public void removeTarget(Surface outputTarget) {
40470c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala            mRequest.mSurfaceSet.remove(outputTarget);
40570725500dcf3b666b43d50563d64705aab58d2d3Igor Murashkin        }
40670c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala
40770c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala        /**
40870c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         * Set a capture request field to a value. The field definitions can be
40970c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         * found in {@link CaptureRequest}.
41070c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         *
41170c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         * @param key The metadata field to write.
41270c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         * @param value The value to set the field to, which must be of a matching
41370c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         * type to the key.
41470c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         */
41570c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala        public <T> void set(Key<T> key, T value) {
41670c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala            mRequest.mSettings.set(key, value);
41770c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala        }
41870c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala
41970c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala        /**
42070c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         * Get a capture request field value. The field definitions can be
42170c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         * found in {@link CaptureRequest}.
42270c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         *
42370c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         * @throws IllegalArgumentException if the key was not valid
42470c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         *
42570c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         * @param key The metadata field to read.
42670c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         * @return The value of that key, or {@code null} if the field is not set.
42770c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         */
42870c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala        public <T> T get(Key<T> key) {
42970c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala            return mRequest.mSettings.get(key);
43070c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala        }
43170c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala
43270c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala        /**
43370c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         * Set a tag for this request.
43470c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         *
43570c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         * <p>This tag is not used for anything by the camera device, but can be
43670c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         * used by an application to easily identify a CaptureRequest when it is
43770c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         * returned by
438fd887436bd111e4d2c7307578a51b5070025b7f2Eino-Ville Talvala         * {@link CameraCaptureSession.CaptureCallback#onCaptureCompleted CaptureCallback.onCaptureCompleted}
43970c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         *
44070c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         * @param tag an arbitrary Object to store with this request
44170c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         * @see CaptureRequest#getTag
44270c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         */
44370c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala        public void setTag(Object tag) {
44470c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala            mRequest.mUserTag = tag;
44570c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala        }
44670c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala
44770c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala        /**
44870c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         * Build a request using the current target Surfaces and settings.
449edeab40338a047655f6af60e9e950dbad262279bSol Boucher         * <p>Note that, although it is possible to create a {@code CaptureRequest} with no target
450edeab40338a047655f6af60e9e950dbad262279bSol Boucher         * {@link Surface}s, passing such a request into {@link CameraCaptureSession#capture},
451edeab40338a047655f6af60e9e950dbad262279bSol Boucher         * {@link CameraCaptureSession#captureBurst},
452edeab40338a047655f6af60e9e950dbad262279bSol Boucher         * {@link CameraCaptureSession#setRepeatingBurst}, or
453edeab40338a047655f6af60e9e950dbad262279bSol Boucher         * {@link CameraCaptureSession#setRepeatingRequest} will cause that method to throw an
454edeab40338a047655f6af60e9e950dbad262279bSol Boucher         * {@link IllegalArgumentException}.</p>
45570c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         *
45670c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         * @return A new capture request instance, ready for submission to the
45770c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         * camera device.
45870c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         */
45970c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala        public CaptureRequest build() {
46070c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala            return new CaptureRequest(mRequest);
46170c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala        }
46270c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala
46370c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala
46470c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala        /**
46570c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         * @hide
46670c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala         */
46770c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala        public boolean isEmpty() {
46870c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala            return mRequest.mSettings.isEmpty();
46970c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala        }
47070c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala
471b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala    }
472b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala
4735a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
4745a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * The key entries below this point are generated from metadata
4755a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * definitions in /system/media/camera/docs. Do not modify by hand or
4765a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * modify the comment blocks at the start or end.
4775a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/
4785a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
4795a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
4807d2a5c5e7350658d0da4eaf75f9380593083e969Igor Murashkin     * <p>The mode control selects how the image data is converted from the
4817d2a5c5e7350658d0da4eaf75f9380593083e969Igor Murashkin     * sensor's native color into linear sRGB color.</p>
482b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <p>When auto-white balance (AWB) is enabled with {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, this
4837d2a5c5e7350658d0da4eaf75f9380593083e969Igor Murashkin     * control is overridden by the AWB routine. When AWB is disabled, the
4847d2a5c5e7350658d0da4eaf75f9380593083e969Igor Murashkin     * application controls how the color mapping is performed.</p>
4857d2a5c5e7350658d0da4eaf75f9380593083e969Igor Murashkin     * <p>We define the expected processing pipeline below. For consistency
4867d2a5c5e7350658d0da4eaf75f9380593083e969Igor Murashkin     * across devices, this is always the case with TRANSFORM_MATRIX.</p>
4877d2a5c5e7350658d0da4eaf75f9380593083e969Igor Murashkin     * <p>When either FULL or HIGH_QUALITY is used, the camera device may
4887d2a5c5e7350658d0da4eaf75f9380593083e969Igor Murashkin     * do additional processing but {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
4897d2a5c5e7350658d0da4eaf75f9380593083e969Igor Murashkin     * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} will still be provided by the
4907d2a5c5e7350658d0da4eaf75f9380593083e969Igor Murashkin     * camera device (in the results) and be roughly correct.</p>
4917d2a5c5e7350658d0da4eaf75f9380593083e969Igor Murashkin     * <p>Switching to TRANSFORM_MATRIX and using the data provided from
4927d2a5c5e7350658d0da4eaf75f9380593083e969Igor Murashkin     * FAST or HIGH_QUALITY will yield a picture with the same white point
4937d2a5c5e7350658d0da4eaf75f9380593083e969Igor Murashkin     * as what was produced by the camera device in the earlier frame.</p>
4947d2a5c5e7350658d0da4eaf75f9380593083e969Igor Murashkin     * <p>The expected processing pipeline is as follows:</p>
4957d2a5c5e7350658d0da4eaf75f9380593083e969Igor Murashkin     * <p><img alt="White balance processing pipeline" src="../../../../images/camera2/metadata/android.colorCorrection.mode/processing_pipeline.png" /></p>
4967d2a5c5e7350658d0da4eaf75f9380593083e969Igor Murashkin     * <p>The white balance is encoded by two values, a 4-channel white-balance
4977d2a5c5e7350658d0da4eaf75f9380593083e969Igor Murashkin     * gain vector (applied in the Bayer domain), and a 3x3 color transform
4987d2a5c5e7350658d0da4eaf75f9380593083e969Igor Murashkin     * matrix (applied after demosaic).</p>
4997d2a5c5e7350658d0da4eaf75f9380593083e969Igor Murashkin     * <p>The 4-channel white-balance gains are defined as:</p>
5007d2a5c5e7350658d0da4eaf75f9380593083e969Igor Murashkin     * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} = [ R G_even G_odd B ]
5017d2a5c5e7350658d0da4eaf75f9380593083e969Igor Murashkin     * </code></pre>
5027d2a5c5e7350658d0da4eaf75f9380593083e969Igor Murashkin     * <p>where <code>G_even</code> is the gain for green pixels on even rows of the
5037d2a5c5e7350658d0da4eaf75f9380593083e969Igor Murashkin     * output, and <code>G_odd</code> is the gain for green pixels on the odd rows.
5047d2a5c5e7350658d0da4eaf75f9380593083e969Igor Murashkin     * These may be identical for a given camera device implementation; if
5057d2a5c5e7350658d0da4eaf75f9380593083e969Igor Murashkin     * the camera device does not support a separate gain for even/odd green
5067d2a5c5e7350658d0da4eaf75f9380593083e969Igor Murashkin     * channels, it will use the <code>G_even</code> value, and write <code>G_odd</code> equal to
5077d2a5c5e7350658d0da4eaf75f9380593083e969Igor Murashkin     * <code>G_even</code> in the output result metadata.</p>
5087d2a5c5e7350658d0da4eaf75f9380593083e969Igor Murashkin     * <p>The matrices for color transforms are defined as a 9-entry vector:</p>
5097d2a5c5e7350658d0da4eaf75f9380593083e969Igor Murashkin     * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} = [ I0 I1 I2 I3 I4 I5 I6 I7 I8 ]
5107d2a5c5e7350658d0da4eaf75f9380593083e969Igor Murashkin     * </code></pre>
5117d2a5c5e7350658d0da4eaf75f9380593083e969Igor Murashkin     * <p>which define a transform from input sensor colors, <code>P_in = [ r g b ]</code>,
5127d2a5c5e7350658d0da4eaf75f9380593083e969Igor Murashkin     * to output linear sRGB, <code>P_out = [ r' g' b' ]</code>,</p>
5137d2a5c5e7350658d0da4eaf75f9380593083e969Igor Murashkin     * <p>with colors as follows:</p>
5147d2a5c5e7350658d0da4eaf75f9380593083e969Igor Murashkin     * <pre><code>r' = I0r + I1g + I2b
5157d2a5c5e7350658d0da4eaf75f9380593083e969Igor Murashkin     * g' = I3r + I4g + I5b
5167d2a5c5e7350658d0da4eaf75f9380593083e969Igor Murashkin     * b' = I6r + I7g + I8b
5177d2a5c5e7350658d0da4eaf75f9380593083e969Igor Murashkin     * </code></pre>
5187d2a5c5e7350658d0da4eaf75f9380593083e969Igor Murashkin     * <p>Both the input and output value ranges must match. Overflow/underflow
5197d2a5c5e7350658d0da4eaf75f9380593083e969Igor Murashkin     * values are clipped to fit within the range.</p>
520fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
521fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
522fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX TRANSFORM_MATRIX}</li>
523fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #COLOR_CORRECTION_MODE_FAST FAST}</li>
524fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #COLOR_CORRECTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
525fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
5264b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
5274b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Full capability</b> -
5284b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
5294b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
5300da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     *
5317d2a5c5e7350658d0da4eaf75f9380593083e969Igor Murashkin     * @see CaptureRequest#COLOR_CORRECTION_GAINS
5327d2a5c5e7350658d0da4eaf75f9380593083e969Igor Murashkin     * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
5330da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * @see CaptureRequest#CONTROL_AWB_MODE
5344b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
5355a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX
5365a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #COLOR_CORRECTION_MODE_FAST
5375a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #COLOR_CORRECTION_MODE_HIGH_QUALITY
5385a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
5396c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
5405a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Integer> COLOR_CORRECTION_MODE =
5415a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Integer>("android.colorCorrection.mode", int.class);
5425a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
5435a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
544ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>A color transform matrix to use to transform
545b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * from sensor RGB color space to output linear sRGB color space.</p>
54649a3ca9330d213fe35280c0af78a4d21acb98234Zhijun He     * <p>This matrix is either set by the camera device when the request
5470da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or
5485a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * directly by the application in the request when the
5490da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p>
55049a3ca9330d213fe35280c0af78a4d21acb98234Zhijun He     * <p>In the latter case, the camera device may round the matrix to account
55149a3ca9330d213fe35280c0af78a4d21acb98234Zhijun He     * for precision issues; the final rounded matrix should be reported back
55249a3ca9330d213fe35280c0af78a4d21acb98234Zhijun He     * in this matrix result metadata. The transform should keep the magnitude
55349a3ca9330d213fe35280c0af78a4d21acb98234Zhijun He     * of the output color values within <code>[0, 1.0]</code> (assuming input color
55449a3ca9330d213fe35280c0af78a4d21acb98234Zhijun He     * values is within the normalized range <code>[0, 1.0]</code>), or clipping may occur.</p>
555d9fc67ce3c1498a911df39675b61b96ec1364f08Yin-Chia Yeh     * <p>The valid range of each matrix element varies on different devices, but
556d9fc67ce3c1498a911df39675b61b96ec1364f08Yin-Chia Yeh     * values within [-1.5, 3.0] are guaranteed not to be clipped.</p>
557fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Units</b>: Unitless scale factors</p>
5584b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
5594b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Full capability</b> -
5604b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
5614b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
5620da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     *
5630da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * @see CaptureRequest#COLOR_CORRECTION_MODE
5644b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
5655a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
5666c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
5672bb91a7a68e32530adf730deeef2fe95bad20a96Eino-Ville Talvala    public static final Key<android.hardware.camera2.params.ColorSpaceTransform> COLOR_CORRECTION_TRANSFORM =
5682bb91a7a68e32530adf730deeef2fe95bad20a96Eino-Ville Talvala            new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.colorCorrection.transform", android.hardware.camera2.params.ColorSpaceTransform.class);
5695a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
5705a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
5717d2a5c5e7350658d0da4eaf75f9380593083e969Igor Murashkin     * <p>Gains applying to Bayer raw color channels for
572cc28a41b48bc687002a9e1fc436d00ca6f0c3692Zhijun He     * white-balance.</p>
5732bb91a7a68e32530adf730deeef2fe95bad20a96Eino-Ville Talvala     * <p>These per-channel gains are either set by the camera device
5742bb91a7a68e32530adf730deeef2fe95bad20a96Eino-Ville Talvala     * when the request {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not
5752bb91a7a68e32530adf730deeef2fe95bad20a96Eino-Ville Talvala     * TRANSFORM_MATRIX, or directly by the application in the
5762bb91a7a68e32530adf730deeef2fe95bad20a96Eino-Ville Talvala     * request when the {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is
5772bb91a7a68e32530adf730deeef2fe95bad20a96Eino-Ville Talvala     * TRANSFORM_MATRIX.</p>
5782bb91a7a68e32530adf730deeef2fe95bad20a96Eino-Ville Talvala     * <p>The gains in the result metadata are the gains actually
5792bb91a7a68e32530adf730deeef2fe95bad20a96Eino-Ville Talvala     * applied by the camera device to the current frame.</p>
580d9fc67ce3c1498a911df39675b61b96ec1364f08Yin-Chia Yeh     * <p>The valid range of gains varies on different devices, but gains
581d9fc67ce3c1498a911df39675b61b96ec1364f08Yin-Chia Yeh     * between [1.0, 3.0] are guaranteed not to be clipped. Even if a given
582d9fc67ce3c1498a911df39675b61b96ec1364f08Yin-Chia Yeh     * device allows gains below 1.0, this is usually not recommended because
583d9fc67ce3c1498a911df39675b61b96ec1364f08Yin-Chia Yeh     * this can create color artifacts.</p>
584fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Units</b>: Unitless gain factors</p>
5854b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
5864b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Full capability</b> -
5874b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
5884b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
5890da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     *
5900da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * @see CaptureRequest#COLOR_CORRECTION_MODE
5914b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
5925a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
5936c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
5942bb91a7a68e32530adf730deeef2fe95bad20a96Eino-Ville Talvala    public static final Key<android.hardware.camera2.params.RggbChannelVector> COLOR_CORRECTION_GAINS =
5952bb91a7a68e32530adf730deeef2fe95bad20a96Eino-Ville Talvala            new Key<android.hardware.camera2.params.RggbChannelVector>("android.colorCorrection.gains", android.hardware.camera2.params.RggbChannelVector.class);
5965a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
5975a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
598a05e59d12b410638e97bc2d88c64442c47907fe3Zhijun He     * <p>Mode of operation for the chromatic aberration correction algorithm.</p>
599a05e59d12b410638e97bc2d88c64442c47907fe3Zhijun He     * <p>Chromatic (color) aberration is caused by the fact that different wavelengths of light
600a05e59d12b410638e97bc2d88c64442c47907fe3Zhijun He     * can not focus on the same point after exiting from the lens. This metadata defines
601a05e59d12b410638e97bc2d88c64442c47907fe3Zhijun He     * the high level control of chromatic aberration correction algorithm, which aims to
602a05e59d12b410638e97bc2d88c64442c47907fe3Zhijun He     * minimize the chromatic artifacts that may occur along the object boundaries in an
603a05e59d12b410638e97bc2d88c64442c47907fe3Zhijun He     * image.</p>
604a05e59d12b410638e97bc2d88c64442c47907fe3Zhijun He     * <p>FAST/HIGH_QUALITY both mean that camera device determined aberration
605a05e59d12b410638e97bc2d88c64442c47907fe3Zhijun He     * correction will be applied. HIGH_QUALITY mode indicates that the camera device will
606a05e59d12b410638e97bc2d88c64442c47907fe3Zhijun He     * use the highest-quality aberration correction algorithms, even if it slows down
607a05e59d12b410638e97bc2d88c64442c47907fe3Zhijun He     * capture rate. FAST means the camera device will not slow down capture rate when
608a05e59d12b410638e97bc2d88c64442c47907fe3Zhijun He     * applying aberration correction.</p>
6094b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>LEGACY devices will always be in FAST mode.</p>
610fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
611fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
612fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_OFF OFF}</li>
613fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_FAST FAST}</li>
614fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
615fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
616fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Available values for this device:</b><br>
617fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES android.colorCorrection.availableAberrationModes}</p>
6184b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
619a05e59d12b410638e97bc2d88c64442c47907fe3Zhijun He     *
6209e4e439a688f1859cd895f2ff7ecad75cddb116bZhijun He     * @see CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES
6219e4e439a688f1859cd895f2ff7ecad75cddb116bZhijun He     * @see #COLOR_CORRECTION_ABERRATION_MODE_OFF
6229e4e439a688f1859cd895f2ff7ecad75cddb116bZhijun He     * @see #COLOR_CORRECTION_ABERRATION_MODE_FAST
6239e4e439a688f1859cd895f2ff7ecad75cddb116bZhijun He     * @see #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY
624a05e59d12b410638e97bc2d88c64442c47907fe3Zhijun He     */
6256c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
6269e4e439a688f1859cd895f2ff7ecad75cddb116bZhijun He    public static final Key<Integer> COLOR_CORRECTION_ABERRATION_MODE =
6279e4e439a688f1859cd895f2ff7ecad75cddb116bZhijun He            new Key<Integer>("android.colorCorrection.aberrationMode", int.class);
628a05e59d12b410638e97bc2d88c64442c47907fe3Zhijun He
629a05e59d12b410638e97bc2d88c64442c47907fe3Zhijun He    /**
6300da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * <p>The desired setting for the camera device's auto-exposure
6310da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * algorithm's antibanding compensation.</p>
6320da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * <p>Some kinds of lighting fixtures, such as some fluorescent
6330da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * lights, flicker at the rate of the power supply frequency
6340da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * (60Hz or 50Hz, depending on country). While this is
6350da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * typically not noticeable to a person, it can be visible to
6360da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * a camera device. If a camera sets its exposure time to the
6370da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * wrong value, the flicker may become visible in the
6380da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * viewfinder as flicker or in a final captured image, as a
6390da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * set of variable-brightness bands across the image.</p>
6400da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * <p>Therefore, the auto-exposure routines of camera devices
6410da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * include antibanding routines that ensure that the chosen
6420da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * exposure value will not cause such banding. The choice of
6430da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * exposure time depends on the rate of flicker, which the
6440da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * camera device can detect automatically, or the expected
6450da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * rate can be selected by the application using this
6460da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * control.</p>
6470da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * <p>A given camera device may not support all of the possible
6480da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * options for the antibanding mode. The
6490da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes} key contains
6500da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * the available modes for a given camera device.</p>
6517b2cae6ceca680f6034a9fe43df2446cbae2f090Yin-Chia Yeh     * <p>AUTO mode is the default if it is available on given
6527b2cae6ceca680f6034a9fe43df2446cbae2f090Yin-Chia Yeh     * camera device. When AUTO mode is not available, the
6537b2cae6ceca680f6034a9fe43df2446cbae2f090Yin-Chia Yeh     * default will be either 50HZ or 60HZ, and both 50HZ
6547b2cae6ceca680f6034a9fe43df2446cbae2f090Yin-Chia Yeh     * and 60HZ will be available.</p>
6550da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * <p>If manual exposure control is enabled (by setting
6560da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} to OFF),
6570da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * then this setting has no effect, and the application must
6580da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * ensure it selects exposure times that do not cause banding
6590da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * issues. The {@link CaptureResult#STATISTICS_SCENE_FLICKER android.statistics.sceneFlicker} key can assist
6600da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * the application in this.</p>
661fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
662fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
663fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AE_ANTIBANDING_MODE_OFF OFF}</li>
664fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AE_ANTIBANDING_MODE_50HZ 50HZ}</li>
665fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AE_ANTIBANDING_MODE_60HZ 60HZ}</li>
666fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AE_ANTIBANDING_MODE_AUTO AUTO}</li>
667fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
668fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Available values for this device:</b><br></p>
669fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>{@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes}</p>
6704b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
6710da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     *
6725f2a47f3dedfc7859457067d8cdcdbfc28ee08acZhijun He     * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES
673399f05d1e7182ef6c88d30d3b98a467b845ca7c4Zhijun He     * @see CaptureRequest#CONTROL_AE_MODE
674265b34ce331cbe296f82ca357645312718c8d4c7Eino-Ville Talvala     * @see CaptureRequest#CONTROL_MODE
675265b34ce331cbe296f82ca357645312718c8d4c7Eino-Ville Talvala     * @see CaptureResult#STATISTICS_SCENE_FLICKER
6765a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AE_ANTIBANDING_MODE_OFF
6775a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AE_ANTIBANDING_MODE_50HZ
6785a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AE_ANTIBANDING_MODE_60HZ
6795a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AE_ANTIBANDING_MODE_AUTO
6805a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
6816c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
6825a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Integer> CONTROL_AE_ANTIBANDING_MODE =
6835a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Integer>("android.control.aeAntibandingMode", int.class);
6845a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
6855a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
686b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <p>Adjustment to auto-exposure (AE) target image
687b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * brightness.</p>
688b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <p>The adjustment is measured as a count of steps, with the
689b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * step size defined by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep} and the
690b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * allowed range by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}.</p>
691b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <p>For example, if the exposure value (EV) step is 0.333, '6'
692b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * will mean an exposure compensation of +2 EV; -3 will mean an
693b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * exposure compensation of -1 EV. One EV represents a doubling
694b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * of image brightness. Note that this control will only be
695b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF. This control
696b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * will take effect even when {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} <code>== true</code>.</p>
697a4227dfe48dcfb49709e05f7db413e0d883997f0Yin-Chia Yeh     * <p>In the event of exposure compensation value being changed, camera device
698a4227dfe48dcfb49709e05f7db413e0d883997f0Yin-Chia Yeh     * may take several frames to reach the newly requested exposure target.
699a4227dfe48dcfb49709e05f7db413e0d883997f0Yin-Chia Yeh     * During that time, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} field will be in the SEARCHING
700a4227dfe48dcfb49709e05f7db413e0d883997f0Yin-Chia Yeh     * state. Once the new exposure target is reached, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} will
701a4227dfe48dcfb49709e05f7db413e0d883997f0Yin-Chia Yeh     * change from SEARCHING to either CONVERGED, LOCKED (if AE lock is enabled), or
702a4227dfe48dcfb49709e05f7db413e0d883997f0Yin-Chia Yeh     * FLASH_REQUIRED (if the scene is too dark for still capture).</p>
703fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Units</b>: Compensation steps</p>
704fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
705fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}</p>
7064b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
707a4227dfe48dcfb49709e05f7db413e0d883997f0Yin-Chia Yeh     *
708b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE
709b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP
710a4227dfe48dcfb49709e05f7db413e0d883997f0Yin-Chia Yeh     * @see CaptureRequest#CONTROL_AE_LOCK
711a4227dfe48dcfb49709e05f7db413e0d883997f0Yin-Chia Yeh     * @see CaptureRequest#CONTROL_AE_MODE
712a4227dfe48dcfb49709e05f7db413e0d883997f0Yin-Chia Yeh     * @see CaptureResult#CONTROL_AE_STATE
7135a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
7146c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
7155a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Integer> CONTROL_AE_EXPOSURE_COMPENSATION =
7165a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Integer>("android.control.aeExposureCompensation", int.class);
7175a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
7185a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
719b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <p>Whether auto-exposure (AE) is currently locked to its latest
72049a3ca9330d213fe35280c0af78a4d21acb98234Zhijun He     * calculated values.</p>
721fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>When set to <code>true</code> (ON), the AE algorithm is locked to its latest parameters,
722fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * and will not change exposure settings until the lock is set to <code>false</code> (OFF).</p>
723fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Note that even when AE is locked, the flash may be fired if
724fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_AUTO_FLASH /
725fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * ON_ALWAYS_FLASH / ON_AUTO_FLASH_REDEYE.</p>
726a4227dfe48dcfb49709e05f7db413e0d883997f0Yin-Chia Yeh     * <p>When {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation} is changed, even if the AE lock
727a4227dfe48dcfb49709e05f7db413e0d883997f0Yin-Chia Yeh     * is ON, the camera device will still adjust its exposure value.</p>
72849a3ca9330d213fe35280c0af78a4d21acb98234Zhijun He     * <p>If AE precapture is triggered (see {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger})
72949a3ca9330d213fe35280c0af78a4d21acb98234Zhijun He     * when AE is already locked, the camera device will not change the exposure time
73049a3ca9330d213fe35280c0af78a4d21acb98234Zhijun He     * ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}) and sensitivity ({@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity})
731d8fd67931e17c66e530de5482b63863e6c4301aaEino-Ville Talvala     * parameters. The flash may be fired if the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}
73249a3ca9330d213fe35280c0af78a4d21acb98234Zhijun He     * is ON_AUTO_FLASH/ON_AUTO_FLASH_REDEYE and the scene is too dark. If the
73349a3ca9330d213fe35280c0af78a4d21acb98234Zhijun He     * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_ALWAYS_FLASH, the scene may become overexposed.</p>
734fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Since the camera device has a pipeline of in-flight requests, the settings that
735fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * get locked do not necessarily correspond to the settings that were present in the
736fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * latest capture result received from the camera device, since additional captures
737fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * and AE updates may have occurred even before the result was sent out. If an
738fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * application is switching between automatic and manual control and wishes to eliminate
739fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * any flicker during the switch, the following procedure is recommended:</p>
740fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ol>
741fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <li>Starting in auto-AE mode:</li>
742fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <li>Lock AE</li>
743fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <li>Wait for the first result to be output that has the AE locked</li>
744fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <li>Copy exposure settings from that result into a request, set the request to manual AE</li>
745fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <li>Submit the capture request, proceed to run manual AE as desired.</li>
746fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ol>
74749a3ca9330d213fe35280c0af78a4d21acb98234Zhijun He     * <p>See {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE lock related state transition details.</p>
7484b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
74949a3ca9330d213fe35280c0af78a4d21acb98234Zhijun He     *
750a4227dfe48dcfb49709e05f7db413e0d883997f0Yin-Chia Yeh     * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
75149a3ca9330d213fe35280c0af78a4d21acb98234Zhijun He     * @see CaptureRequest#CONTROL_AE_MODE
75249a3ca9330d213fe35280c0af78a4d21acb98234Zhijun He     * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
75349a3ca9330d213fe35280c0af78a4d21acb98234Zhijun He     * @see CaptureResult#CONTROL_AE_STATE
75449a3ca9330d213fe35280c0af78a4d21acb98234Zhijun He     * @see CaptureRequest#SENSOR_EXPOSURE_TIME
75549a3ca9330d213fe35280c0af78a4d21acb98234Zhijun He     * @see CaptureRequest#SENSOR_SENSITIVITY
7565a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
7576c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
7585a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Boolean> CONTROL_AE_LOCK =
7595a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Boolean>("android.control.aeLock", boolean.class);
7605a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
7615a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
7620da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * <p>The desired mode for the camera device's
7630da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * auto-exposure routine.</p>
7640da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is
7650da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * AUTO.</p>
7660da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * <p>When set to any of the ON modes, the camera device's
7670da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * auto-exposure routine is enabled, overriding the
7680da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * application's selected exposure time, sensor sensitivity,
7690da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * and frame duration ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
7700da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and
7710da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}). If one of the FLASH modes
7720da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * is selected, the camera device's flash unit controls are
7730da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * also overridden.</p>
7740da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * <p>The FLASH modes are only available if the camera device
7750da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * has a flash unit ({@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} is <code>true</code>).</p>
7760da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * <p>If flash TORCH mode is desired, this field must be set to
7770da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * ON or OFF, and {@link CaptureRequest#FLASH_MODE android.flash.mode} set to TORCH.</p>
7780da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * <p>When set to any of the ON modes, the values chosen by the
7790da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * camera device auto-exposure routine for the overridden
7800da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * fields for a given capture will be available in its
7810da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * CaptureResult.</p>
782fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
783fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
784fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AE_MODE_OFF OFF}</li>
785fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AE_MODE_ON ON}</li>
786fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH ON_AUTO_FLASH}</li>
787fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AE_MODE_ON_ALWAYS_FLASH ON_ALWAYS_FLASH}</li>
788fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE ON_AUTO_FLASH_REDEYE}</li>
789fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
790fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Available values for this device:</b><br>
791fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES android.control.aeAvailableModes}</p>
7924b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
7930da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     *
794fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES
7955f2a47f3dedfc7859457067d8cdcdbfc28ee08acZhijun He     * @see CaptureRequest#CONTROL_MODE
796265b34ce331cbe296f82ca357645312718c8d4c7Eino-Ville Talvala     * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
797265b34ce331cbe296f82ca357645312718c8d4c7Eino-Ville Talvala     * @see CaptureRequest#FLASH_MODE
798aef3b7ed9f2a27aed9aecef030432d1100a60406Igor Murashkin     * @see CaptureRequest#SENSOR_EXPOSURE_TIME
799aef3b7ed9f2a27aed9aecef030432d1100a60406Igor Murashkin     * @see CaptureRequest#SENSOR_FRAME_DURATION
800399f05d1e7182ef6c88d30d3b98a467b845ca7c4Zhijun He     * @see CaptureRequest#SENSOR_SENSITIVITY
8015a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AE_MODE_OFF
8025a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AE_MODE_ON
8035a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AE_MODE_ON_AUTO_FLASH
8045a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AE_MODE_ON_ALWAYS_FLASH
8055a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE
8065a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
8076c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
8085a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Integer> CONTROL_AE_MODE =
8095a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Integer>("android.control.aeMode", int.class);
8105a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
8115a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
812fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>List of metering areas to use for auto-exposure adjustment.</p>
813fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe} is 0.
814808150f066b53da1573e8b1fbd6b377d0fc229f8Yin-Chia Yeh     * Otherwise will always be present.</p>
815fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>The maximum number of regions supported by the device is determined by the value
816fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe}.</p>
817ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>The coordinate system is based on the active pixel array,
8182629f27362f1a35521501f3a28279ab05b9beb32Timothy Knight     * with (0,0) being the top-left pixel in the active pixel array, and
8190da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
8200da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
82197f1c854993a65b2c700426a1e3a83b23ea65337Yin-Chia Yeh     * bottom-right pixel in the active pixel array.</p>
822fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight
82397f1c854993a65b2c700426a1e3a83b23ea65337Yin-Chia Yeh     * for every pixel in the area. This means that a large metering area
82497f1c854993a65b2c700426a1e3a83b23ea65337Yin-Chia Yeh     * with the same weight as a smaller area will have more effect in
82597f1c854993a65b2c700426a1e3a83b23ea65337Yin-Chia Yeh     * the metering result. Metering areas can partially overlap and the
82697f1c854993a65b2c700426a1e3a83b23ea65337Yin-Chia Yeh     * camera device will add the weights in the overlap region.</p>
827fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>The weights are relative to weights of other exposure metering regions, so if only one
828fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * region is used, all non-zero weights will have the same effect. A region with 0
829fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * weight is ignored.</p>
830fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
831fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * camera device.</p>
832fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
833fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * capture result metadata, the camera device will ignore the sections outside the crop
834fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * region and output only the intersection rectangle as the metering region in the result
835fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * metadata.  If the region is entirely outside the crop region, it will be ignored and
836fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * not reported in the result metadata.</p>
837fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
838fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
839fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * Coordinates must be between <code>[(0,0), (width, height))</code> of
840fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
841808150f066b53da1573e8b1fbd6b377d0fc229f8Yin-Chia Yeh     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
8420da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     *
843808150f066b53da1573e8b1fbd6b377d0fc229f8Yin-Chia Yeh     * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AE
8440da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * @see CaptureRequest#SCALER_CROP_REGION
845265b34ce331cbe296f82ca357645312718c8d4c7Eino-Ville Talvala     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
8465a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
8476c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
848817f8933ee1c11130ad2ca45b5ac8ce8b729f125Yin-Chia Yeh    public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AE_REGIONS =
849817f8933ee1c11130ad2ca45b5ac8ce8b729f125Yin-Chia Yeh            new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.aeRegions", android.hardware.camera2.params.MeteringRectangle[].class);
8505a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
8515a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
852fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Range over which the auto-exposure routine can
853fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * adjust the capture frame rate to maintain good
854fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * exposure.</p>
855b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <p>Only constrains auto-exposure (AE) algorithm, not
856fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * manual control of {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime} and
857fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}.</p>
858fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Units</b>: Frames per second (FPS)</p>
859fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
860fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * Any of the entries in {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES android.control.aeAvailableTargetFpsRanges}</p>
861fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>This key is available on all devices.</p>
8620da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     *
863fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES
8640da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * @see CaptureRequest#SENSOR_EXPOSURE_TIME
865fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * @see CaptureRequest#SENSOR_FRAME_DURATION
8665a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
8676c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
86878712a8bd7275542013ba099f33536eead0167fbIgor Murashkin    public static final Key<android.util.Range<Integer>> CONTROL_AE_TARGET_FPS_RANGE =
86978712a8bd7275542013ba099f33536eead0167fbIgor Murashkin            new Key<android.util.Range<Integer>>("android.control.aeTargetFpsRange", new TypeReference<android.util.Range<Integer>>() {{ }});
8705a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
8715a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
872228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <p>Whether the camera device will trigger a precapture
873228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * metering sequence when it processes this request.</p>
874ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>This entry is normally set to IDLE, or is not
8755a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * included at all in the request settings. When included and
876228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * set to START, the camera device will trigger the autoexposure
877ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * precapture metering sequence.</p>
878e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * <p>The precapture sequence should triggered before starting a
879e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * high-quality still capture for final metering decisions to
880e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * be made, and for firing pre-capture flash pulses to estimate
881e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * scene brightness and required final capture flash power, when
882e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * the flash is enabled.</p>
883e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * <p>Normally, this entry should be set to START for only a
884e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * single request, and the application should wait until the
885e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * sequence completes before starting a new one.</p>
886e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * <p>The exact effect of auto-exposure (AE) precapture trigger
887e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * depends on the current AE mode and state; see
888b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE precapture state transition
889b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * details.</p>
890fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>On LEGACY-level devices, the precapture trigger is not supported;
891fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * capturing a high-resolution JPEG image will automatically trigger a
892fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * precapture sequence before the high-resolution capture, including
893fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * potentially firing a pre-capture flash.</p>
894fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
895fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
896fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE IDLE}</li>
897fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_START START}</li>
898fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
8994b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
9004b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Limited capability</b> -
9014b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
9024b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
903228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     *
904228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * @see CaptureResult#CONTROL_AE_STATE
9054b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
9065a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE
9075a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AE_PRECAPTURE_TRIGGER_START
9085a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
9096c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
9105a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Integer> CONTROL_AE_PRECAPTURE_TRIGGER =
9115a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Integer>("android.control.aePrecaptureTrigger", int.class);
9125a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
9135a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
914b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <p>Whether auto-focus (AF) is currently enabled, and what
915b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * mode it is set to.</p>
916cc28a41b48bc687002a9e1fc436d00ca6f0c3692Zhijun He     * <p>Only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} = AUTO and the lens is not fixed focus
9177144b5d2cf445ed245cfd9b09c7897966d01b5ffYin-Chia Yeh     * (i.e. <code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} &gt; 0</code>). Also note that
9187144b5d2cf445ed245cfd9b09c7897966d01b5ffYin-Chia Yeh     * when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF, the behavior of AF is device
9197144b5d2cf445ed245cfd9b09c7897966d01b5ffYin-Chia Yeh     * dependent. It is recommended to lock AF by using {@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger} before
9207144b5d2cf445ed245cfd9b09c7897966d01b5ffYin-Chia Yeh     * setting {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} to OFF, or set AF mode to OFF when AE is OFF.</p>
92178146ecb24871302a4c4dc0a7341044a06d29ee8Zhijun He     * <p>If the lens is controlled by the camera device auto-focus algorithm,
922d8fd67931e17c66e530de5482b63863e6c4301aaEino-Ville Talvala     * the camera device will report the current AF status in {@link CaptureResult#CONTROL_AF_STATE android.control.afState}
923fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * in result metadata.</p>
924fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
925fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
926fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AF_MODE_OFF OFF}</li>
927fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AF_MODE_AUTO AUTO}</li>
928fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AF_MODE_MACRO MACRO}</li>
929fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AF_MODE_CONTINUOUS_VIDEO CONTINUOUS_VIDEO}</li>
930fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AF_MODE_CONTINUOUS_PICTURE CONTINUOUS_PICTURE}</li>
931fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AF_MODE_EDOF EDOF}</li>
932fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
933fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Available values for this device:</b><br>
934fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES android.control.afAvailableModes}</p>
935fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>This key is available on all devices.</p>
9360da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     *
9377144b5d2cf445ed245cfd9b09c7897966d01b5ffYin-Chia Yeh     * @see CaptureRequest#CONTROL_AE_MODE
938fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * @see CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES
939d8fd67931e17c66e530de5482b63863e6c4301aaEino-Ville Talvala     * @see CaptureResult#CONTROL_AF_STATE
9407144b5d2cf445ed245cfd9b09c7897966d01b5ffYin-Chia Yeh     * @see CaptureRequest#CONTROL_AF_TRIGGER
9410da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * @see CaptureRequest#CONTROL_MODE
942cc28a41b48bc687002a9e1fc436d00ca6f0c3692Zhijun He     * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
9435a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AF_MODE_OFF
9445a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AF_MODE_AUTO
9455a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AF_MODE_MACRO
9465a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO
9475a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE
9485a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AF_MODE_EDOF
9495a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
9506c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
9515a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Integer> CONTROL_AF_MODE =
9525a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Integer>("android.control.afMode", int.class);
9535a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
9545a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
955fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>List of metering areas to use for auto-focus.</p>
956fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf} is 0.
957808150f066b53da1573e8b1fbd6b377d0fc229f8Yin-Chia Yeh     * Otherwise will always be present.</p>
958fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>The maximum number of focus areas supported by the device is determined by the value
959fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf}.</p>
960ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>The coordinate system is based on the active pixel array,
9612629f27362f1a35521501f3a28279ab05b9beb32Timothy Knight     * with (0,0) being the top-left pixel in the active pixel array, and
9620da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
9630da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
96497f1c854993a65b2c700426a1e3a83b23ea65337Yin-Chia Yeh     * bottom-right pixel in the active pixel array.</p>
965fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight
96697f1c854993a65b2c700426a1e3a83b23ea65337Yin-Chia Yeh     * for every pixel in the area. This means that a large metering area
96797f1c854993a65b2c700426a1e3a83b23ea65337Yin-Chia Yeh     * with the same weight as a smaller area will have more effect in
96897f1c854993a65b2c700426a1e3a83b23ea65337Yin-Chia Yeh     * the metering result. Metering areas can partially overlap and the
96997f1c854993a65b2c700426a1e3a83b23ea65337Yin-Chia Yeh     * camera device will add the weights in the overlap region.</p>
970fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>The weights are relative to weights of other metering regions, so if only one region
971fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * is used, all non-zero weights will have the same effect. A region with 0 weight is
972fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * ignored.</p>
973fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
974fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * camera device.</p>
975fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
976fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * capture result metadata, the camera device will ignore the sections outside the crop
977fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * region and output only the intersection rectangle as the metering region in the result
978fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * metadata. If the region is entirely outside the crop region, it will be ignored and
979fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * not reported in the result metadata.</p>
980fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
981fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
982fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * Coordinates must be between <code>[(0,0), (width, height))</code> of
983fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
984808150f066b53da1573e8b1fbd6b377d0fc229f8Yin-Chia Yeh     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
9850da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     *
986808150f066b53da1573e8b1fbd6b377d0fc229f8Yin-Chia Yeh     * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AF
9870da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * @see CaptureRequest#SCALER_CROP_REGION
988265b34ce331cbe296f82ca357645312718c8d4c7Eino-Ville Talvala     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
9895a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
9906c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
991817f8933ee1c11130ad2ca45b5ac8ce8b729f125Yin-Chia Yeh    public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AF_REGIONS =
992817f8933ee1c11130ad2ca45b5ac8ce8b729f125Yin-Chia Yeh            new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.afRegions", android.hardware.camera2.params.MeteringRectangle[].class);
9935a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
9945a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
995228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <p>Whether the camera device will trigger autofocus for this request.</p>
996ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>This entry is normally set to IDLE, or is not
997ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * included at all in the request settings.</p>
998228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <p>When included and set to START, the camera device will trigger the
999228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * autofocus algorithm. If autofocus is disabled, this trigger has no effect.</p>
1000228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <p>When set to CANCEL, the camera device will cancel any active trigger,
1001228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * and return to its initial AF state.</p>
1002e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * <p>Generally, applications should set this entry to START or CANCEL for only a
1003e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * single capture, and then return it to IDLE (or not set at all). Specifying
1004e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * START for multiple captures in a row means restarting the AF operation over
1005e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * and over again.</p>
1006e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * <p>See {@link CaptureResult#CONTROL_AF_STATE android.control.afState} for what the trigger means for each AF mode.</p>
1007fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
1008fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
1009fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AF_TRIGGER_IDLE IDLE}</li>
1010fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AF_TRIGGER_START START}</li>
1011fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AF_TRIGGER_CANCEL CANCEL}</li>
1012fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
10134b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
1014228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     *
1015228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * @see CaptureResult#CONTROL_AF_STATE
10165a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AF_TRIGGER_IDLE
10175a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AF_TRIGGER_START
10185a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AF_TRIGGER_CANCEL
10195a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
10206c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
10215a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Integer> CONTROL_AF_TRIGGER =
10225a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Integer>("android.control.afTrigger", int.class);
10235a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
10245a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
1025b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <p>Whether auto-white balance (AWB) is currently locked to its
10262d5e89778e955b4ff209a93e738761356349d48cZhijun He     * latest calculated values.</p>
1027fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>When set to <code>true</code> (ON), the AWB algorithm is locked to its latest parameters,
1028fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * and will not change color balance settings until the lock is set to <code>false</code> (OFF).</p>
1029fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Since the camera device has a pipeline of in-flight requests, the settings that
1030fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * get locked do not necessarily correspond to the settings that were present in the
1031fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * latest capture result received from the camera device, since additional captures
1032fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * and AWB updates may have occurred even before the result was sent out. If an
1033fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * application is switching between automatic and manual control and wishes to eliminate
1034fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * any flicker during the switch, the following procedure is recommended:</p>
1035fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ol>
1036fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <li>Starting in auto-AWB mode:</li>
1037fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <li>Lock AWB</li>
1038fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <li>Wait for the first result to be output that has the AWB locked</li>
1039fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <li>Copy AWB settings from that result into a request, set the request to manual AWB</li>
1040fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <li>Submit the capture request, proceed to run manual AWB as desired.</li>
1041fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ol>
1042e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * <p>Note that AWB lock is only meaningful when
1043e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is in the AUTO mode; in other modes,
1044e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * AWB is already fixed to a specific setting.</p>
10454b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>Some LEGACY devices may not support ON; the value is then overridden to OFF.</p>
10464b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
1047e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     *
1048e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * @see CaptureRequest#CONTROL_AWB_MODE
10495a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
10506c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
10515a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Boolean> CONTROL_AWB_LOCK =
10525a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Boolean>("android.control.awbLock", boolean.class);
10535a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
10545a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
1055b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <p>Whether auto-white balance (AWB) is currently setting the color
10565a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * transform fields, and what its illumination target
1057cc28a41b48bc687002a9e1fc436d00ca6f0c3692Zhijun He     * is.</p>
1058399f05d1e7182ef6c88d30d3b98a467b845ca7c4Zhijun He     * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is AUTO.</p>
1059e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * <p>When set to the ON mode, the camera device's auto-white balance
1060399f05d1e7182ef6c88d30d3b98a467b845ca7c4Zhijun He     * routine is enabled, overriding the application's selected
1061399f05d1e7182ef6c88d30d3b98a467b845ca7c4Zhijun He     * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
10627144b5d2cf445ed245cfd9b09c7897966d01b5ffYin-Chia Yeh     * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}. Note that when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}
10637144b5d2cf445ed245cfd9b09c7897966d01b5ffYin-Chia Yeh     * is OFF, the behavior of AWB is device dependent. It is recommened to
10647144b5d2cf445ed245cfd9b09c7897966d01b5ffYin-Chia Yeh     * also set AWB mode to OFF or lock AWB by using {@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} before
10657144b5d2cf445ed245cfd9b09c7897966d01b5ffYin-Chia Yeh     * setting AE mode to OFF.</p>
1066e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * <p>When set to the OFF mode, the camera device's auto-white balance
1067cc28a41b48bc687002a9e1fc436d00ca6f0c3692Zhijun He     * routine is disabled. The application manually controls the white
1068d8fd67931e17c66e530de5482b63863e6c4301aaEino-Ville Talvala     * balance by {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains}
1069399f05d1e7182ef6c88d30d3b98a467b845ca7c4Zhijun He     * and {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
1070e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * <p>When set to any other modes, the camera device's auto-white
1071e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * balance routine is disabled. The camera device uses each
1072e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * particular illumination target for white balance
1073e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * adjustment. The application's values for
1074e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform},
1075e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
1076e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} are ignored.</p>
1077fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
1078fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
1079fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AWB_MODE_OFF OFF}</li>
1080fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AWB_MODE_AUTO AUTO}</li>
1081fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AWB_MODE_INCANDESCENT INCANDESCENT}</li>
1082fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AWB_MODE_FLUORESCENT FLUORESCENT}</li>
1083fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AWB_MODE_WARM_FLUORESCENT WARM_FLUORESCENT}</li>
1084fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AWB_MODE_DAYLIGHT DAYLIGHT}</li>
1085fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT CLOUDY_DAYLIGHT}</li>
1086fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AWB_MODE_TWILIGHT TWILIGHT}</li>
1087fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AWB_MODE_SHADE SHADE}</li>
1088fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
1089fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Available values for this device:</b><br>
1090fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES android.control.awbAvailableModes}</p>
10914b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
10920da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     *
1093265b34ce331cbe296f82ca357645312718c8d4c7Eino-Ville Talvala     * @see CaptureRequest#COLOR_CORRECTION_GAINS
10945f2a47f3dedfc7859457067d8cdcdbfc28ee08acZhijun He     * @see CaptureRequest#COLOR_CORRECTION_MODE
10955f2a47f3dedfc7859457067d8cdcdbfc28ee08acZhijun He     * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
10967144b5d2cf445ed245cfd9b09c7897966d01b5ffYin-Chia Yeh     * @see CaptureRequest#CONTROL_AE_MODE
1097fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * @see CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES
10987144b5d2cf445ed245cfd9b09c7897966d01b5ffYin-Chia Yeh     * @see CaptureRequest#CONTROL_AWB_LOCK
1099265b34ce331cbe296f82ca357645312718c8d4c7Eino-Ville Talvala     * @see CaptureRequest#CONTROL_MODE
11005a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AWB_MODE_OFF
11015a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AWB_MODE_AUTO
11025a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AWB_MODE_INCANDESCENT
11035a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AWB_MODE_FLUORESCENT
11045a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT
11055a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AWB_MODE_DAYLIGHT
11065a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT
11075a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AWB_MODE_TWILIGHT
11085a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AWB_MODE_SHADE
11095a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
11106c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
11115a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Integer> CONTROL_AWB_MODE =
11125a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Integer>("android.control.awbMode", int.class);
11135a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
11145a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
1115fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>List of metering areas to use for auto-white-balance illuminant
1116f59521d3b182de217b12e6d4ea31bd32e2418564Ruben Brunk     * estimation.</p>
1117fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb} is 0.
1118808150f066b53da1573e8b1fbd6b377d0fc229f8Yin-Chia Yeh     * Otherwise will always be present.</p>
1119fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>The maximum number of regions supported by the device is determined by the value
1120fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb}.</p>
1121ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>The coordinate system is based on the active pixel array,
11222629f27362f1a35521501f3a28279ab05b9beb32Timothy Knight     * with (0,0) being the top-left pixel in the active pixel array, and
11230da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
11240da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
112597f1c854993a65b2c700426a1e3a83b23ea65337Yin-Chia Yeh     * bottom-right pixel in the active pixel array.</p>
112697f1c854993a65b2c700426a1e3a83b23ea65337Yin-Chia Yeh     * <p>The weight must range from 0 to 1000, and represents a weight
112797f1c854993a65b2c700426a1e3a83b23ea65337Yin-Chia Yeh     * for every pixel in the area. This means that a large metering area
112897f1c854993a65b2c700426a1e3a83b23ea65337Yin-Chia Yeh     * with the same weight as a smaller area will have more effect in
112997f1c854993a65b2c700426a1e3a83b23ea65337Yin-Chia Yeh     * the metering result. Metering areas can partially overlap and the
113097f1c854993a65b2c700426a1e3a83b23ea65337Yin-Chia Yeh     * camera device will add the weights in the overlap region.</p>
1131fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>The weights are relative to weights of other white balance metering regions, so if
1132fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * only one region is used, all non-zero weights will have the same effect. A region with
1133fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * 0 weight is ignored.</p>
1134fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
1135fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * camera device.</p>
1136fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
1137fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * capture result metadata, the camera device will ignore the sections outside the crop
1138fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * region and output only the intersection rectangle as the metering region in the result
1139fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * metadata.  If the region is entirely outside the crop region, it will be ignored and
1140fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * not reported in the result metadata.</p>
1141fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
1142fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
1143fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * Coordinates must be between <code>[(0,0), (width, height))</code> of
1144fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
1145808150f066b53da1573e8b1fbd6b377d0fc229f8Yin-Chia Yeh     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
11460da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     *
1147808150f066b53da1573e8b1fbd6b377d0fc229f8Yin-Chia Yeh     * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AWB
11480da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * @see CaptureRequest#SCALER_CROP_REGION
1149265b34ce331cbe296f82ca357645312718c8d4c7Eino-Ville Talvala     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
11505a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
11516c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
1152817f8933ee1c11130ad2ca45b5ac8ce8b729f125Yin-Chia Yeh    public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS =
1153817f8933ee1c11130ad2ca45b5ac8ce8b729f125Yin-Chia Yeh            new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.awbRegions", android.hardware.camera2.params.MeteringRectangle[].class);
11545a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
11555a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
115666d065a6d48cafe390c697c77b44ba5196ee0870Zhijun He     * <p>Information to the camera device 3A (auto-exposure,
115766d065a6d48cafe390c697c77b44ba5196ee0870Zhijun He     * auto-focus, auto-white balance) routines about the purpose
115866d065a6d48cafe390c697c77b44ba5196ee0870Zhijun He     * of this capture, to help the camera device to decide optimal 3A
115966d065a6d48cafe390c697c77b44ba5196ee0870Zhijun He     * strategy.</p>
1160e30adb762ad17fc49fd3f7c1aa9ba6bd24bc43a0Zhijun He     * <p>This control (except for MANUAL) is only effective if
1161e30adb762ad17fc49fd3f7c1aa9ba6bd24bc43a0Zhijun He     * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF</code> and any 3A routine is active.</p>
1162e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * <p>ZERO_SHUTTER_LAG will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
11630e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * contains OPAQUE_REPROCESSING. MANUAL will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
1164fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * contains MANUAL_SENSOR. Other intent values are always supported.</p>
1165fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
1166fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
1167fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_CAPTURE_INTENT_CUSTOM CUSTOM}</li>
1168fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_CAPTURE_INTENT_PREVIEW PREVIEW}</li>
1169fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_CAPTURE_INTENT_STILL_CAPTURE STILL_CAPTURE}</li>
1170fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_RECORD VIDEO_RECORD}</li>
1171fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT VIDEO_SNAPSHOT}</li>
1172fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li>
1173fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_CAPTURE_INTENT_MANUAL MANUAL}</li>
1174fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
1175fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>This key is available on all devices.</p>
11760da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     *
11770da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * @see CaptureRequest#CONTROL_MODE
1178e30adb762ad17fc49fd3f7c1aa9ba6bd24bc43a0Zhijun He     * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
11795a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_CAPTURE_INTENT_CUSTOM
11805a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_CAPTURE_INTENT_PREVIEW
11815a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_CAPTURE_INTENT_STILL_CAPTURE
11825a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_CAPTURE_INTENT_VIDEO_RECORD
11835a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT
11845a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG
1185e30adb762ad17fc49fd3f7c1aa9ba6bd24bc43a0Zhijun He     * @see #CONTROL_CAPTURE_INTENT_MANUAL
11865a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
11876c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
11885a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Integer> CONTROL_CAPTURE_INTENT =
11895a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Integer>("android.control.captureIntent", int.class);
11905a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
11915a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
11925f1dcfe49dfe7b9a4a40482152638af6ca925a6dRuben Brunk     * <p>A special color effect to apply.</p>
11935f1dcfe49dfe7b9a4a40482152638af6ca925a6dRuben Brunk     * <p>When this mode is set, a color effect will be applied
11945f1dcfe49dfe7b9a4a40482152638af6ca925a6dRuben Brunk     * to images produced by the camera device. The interpretation
11955f1dcfe49dfe7b9a4a40482152638af6ca925a6dRuben Brunk     * and implementation of these color effects is left to the
11965f1dcfe49dfe7b9a4a40482152638af6ca925a6dRuben Brunk     * implementor of the camera device, and should not be
11975f1dcfe49dfe7b9a4a40482152638af6ca925a6dRuben Brunk     * depended on to be consistent (or present) across all
11985f1dcfe49dfe7b9a4a40482152638af6ca925a6dRuben Brunk     * devices.</p>
1199fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
1200fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
1201fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_EFFECT_MODE_OFF OFF}</li>
1202fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_EFFECT_MODE_MONO MONO}</li>
1203fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_EFFECT_MODE_NEGATIVE NEGATIVE}</li>
1204fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_EFFECT_MODE_SOLARIZE SOLARIZE}</li>
1205fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_EFFECT_MODE_SEPIA SEPIA}</li>
1206fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_EFFECT_MODE_POSTERIZE POSTERIZE}</li>
1207fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_EFFECT_MODE_WHITEBOARD WHITEBOARD}</li>
1208fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_EFFECT_MODE_BLACKBOARD BLACKBOARD}</li>
1209fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_EFFECT_MODE_AQUA AQUA}</li>
1210fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
1211fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Available values for this device:</b><br>
1212fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS android.control.availableEffects}</p>
12134b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
12140da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     *
1215fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * @see CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS
12165a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_EFFECT_MODE_OFF
12175a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_EFFECT_MODE_MONO
12185a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_EFFECT_MODE_NEGATIVE
12195a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_EFFECT_MODE_SOLARIZE
12205a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_EFFECT_MODE_SEPIA
12215a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_EFFECT_MODE_POSTERIZE
12225a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_EFFECT_MODE_WHITEBOARD
12235a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_EFFECT_MODE_BLACKBOARD
12245a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_EFFECT_MODE_AQUA
12255a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
12266c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
12275a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Integer> CONTROL_EFFECT_MODE =
12285a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Integer>("android.control.effectMode", int.class);
12295a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
12305a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
1231fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Overall mode of 3A (auto-exposure, auto-white-balance, auto-focus) control
1232cc28a41b48bc687002a9e1fc436d00ca6f0c3692Zhijun He     * routines.</p>
1233fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>This is a top-level 3A control switch. When set to OFF, all 3A control
12345f2a47f3dedfc7859457067d8cdcdbfc28ee08acZhijun He     * by the camera device is disabled. The application must set the fields for
1235f353742124af698098884b4172644af0851b30caZhijun He     * capture parameters itself.</p>
1236f353742124af698098884b4172644af0851b30caZhijun He     * <p>When set to AUTO, the individual algorithm controls in
12370da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p>
1238f353742124af698098884b4172644af0851b30caZhijun He     * <p>When set to USE_SCENE_MODE, the individual controls in
12395f2a47f3dedfc7859457067d8cdcdbfc28ee08acZhijun He     * android.control.* are mostly disabled, and the camera device implements
1240f353742124af698098884b4172644af0851b30caZhijun He     * one of the scene mode settings (such as ACTION, SUNSET, or PARTY)
12415f2a47f3dedfc7859457067d8cdcdbfc28ee08acZhijun He     * as it wishes. The camera device scene mode 3A settings are provided by
1242f353742124af698098884b4172644af0851b30caZhijun He     * android.control.sceneModeOverrides.</p>
12432d5e89778e955b4ff209a93e738761356349d48cZhijun He     * <p>When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference
12442d5e89778e955b4ff209a93e738761356349d48cZhijun He     * is that this frame will not be used by camera device background 3A statistics
12452d5e89778e955b4ff209a93e738761356349d48cZhijun He     * update, as if this frame is never captured. This mode can be used in the scenario
12462d5e89778e955b4ff209a93e738761356349d48cZhijun He     * where the application doesn't want a 3A manual control capture to affect
12472d5e89778e955b4ff209a93e738761356349d48cZhijun He     * the subsequent auto 3A capture results.</p>
1248fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
1249fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
1250fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_MODE_OFF OFF}</li>
1251fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_MODE_AUTO AUTO}</li>
1252fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_MODE_USE_SCENE_MODE USE_SCENE_MODE}</li>
1253fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_MODE_OFF_KEEP_STATE OFF_KEEP_STATE}</li>
1254fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
1255d9fc67ce3c1498a911df39675b61b96ec1364f08Yin-Chia Yeh     * <p><b>Available values for this device:</b><br>
1256d9fc67ce3c1498a911df39675b61b96ec1364f08Yin-Chia Yeh     * {@link CameraCharacteristics#CONTROL_AVAILABLE_MODES android.control.availableModes}</p>
12574b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
12580da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     *
12590da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * @see CaptureRequest#CONTROL_AF_MODE
1260d9fc67ce3c1498a911df39675b61b96ec1364f08Yin-Chia Yeh     * @see CameraCharacteristics#CONTROL_AVAILABLE_MODES
12615a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_MODE_OFF
12625a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_MODE_AUTO
12635a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_MODE_USE_SCENE_MODE
12642d5e89778e955b4ff209a93e738761356349d48cZhijun He     * @see #CONTROL_MODE_OFF_KEEP_STATE
12655a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
12666c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
12675a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Integer> CONTROL_MODE =
12685a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Integer>("android.control.mode", int.class);
12695a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
12705a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
1271fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Control for which scene mode is currently active.</p>
1272fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Scene modes are custom camera modes optimized for a certain set of conditions and
1273fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * capture settings.</p>
1274e6679366938fd3ed197ba1ff1b2ad0bf2ff4246bRuben Brunk     * <p>This is the mode that that is active when
1275e6679366938fd3ed197ba1ff1b2ad0bf2ff4246bRuben Brunk     * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code>. Aside from FACE_PRIORITY,
1276e6679366938fd3ed197ba1ff1b2ad0bf2ff4246bRuben Brunk     * these modes will disable {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode},
1277fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, and {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} while in use.</p>
1278e6679366938fd3ed197ba1ff1b2ad0bf2ff4246bRuben Brunk     * <p>The interpretation and implementation of these scene modes is left
1279e6679366938fd3ed197ba1ff1b2ad0bf2ff4246bRuben Brunk     * to the implementor of the camera device. Their behavior will not be
1280e6679366938fd3ed197ba1ff1b2ad0bf2ff4246bRuben Brunk     * consistent across all devices, and any given device may only implement
1281e6679366938fd3ed197ba1ff1b2ad0bf2ff4246bRuben Brunk     * a subset of these modes.</p>
1282fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
1283fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
1284fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_SCENE_MODE_DISABLED DISABLED}</li>
1285fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_SCENE_MODE_FACE_PRIORITY FACE_PRIORITY}</li>
1286fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_SCENE_MODE_ACTION ACTION}</li>
1287fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_SCENE_MODE_PORTRAIT PORTRAIT}</li>
1288fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_SCENE_MODE_LANDSCAPE LANDSCAPE}</li>
1289fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_SCENE_MODE_NIGHT NIGHT}</li>
1290fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_SCENE_MODE_NIGHT_PORTRAIT NIGHT_PORTRAIT}</li>
1291fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_SCENE_MODE_THEATRE THEATRE}</li>
1292fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_SCENE_MODE_BEACH BEACH}</li>
1293fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_SCENE_MODE_SNOW SNOW}</li>
1294fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_SCENE_MODE_SUNSET SUNSET}</li>
1295fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_SCENE_MODE_STEADYPHOTO STEADYPHOTO}</li>
1296fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_SCENE_MODE_FIREWORKS FIREWORKS}</li>
1297fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_SCENE_MODE_SPORTS SPORTS}</li>
1298fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_SCENE_MODE_PARTY PARTY}</li>
1299fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_SCENE_MODE_CANDLELIGHT CANDLELIGHT}</li>
1300fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_SCENE_MODE_BARCODE BARCODE}</li>
1301fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO HIGH_SPEED_VIDEO}</li>
1302f4eac129545fd583d33d9e7ab05cc87f61079bb9Eino-Ville Talvala     *   <li>{@link #CONTROL_SCENE_MODE_HDR HDR}</li>
1303fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
1304fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Available values for this device:</b><br>
1305fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES android.control.availableSceneModes}</p>
13064b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
13070da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     *
1308e6679366938fd3ed197ba1ff1b2ad0bf2ff4246bRuben Brunk     * @see CaptureRequest#CONTROL_AE_MODE
1309e6679366938fd3ed197ba1ff1b2ad0bf2ff4246bRuben Brunk     * @see CaptureRequest#CONTROL_AF_MODE
1310e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * @see CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES
1311e6679366938fd3ed197ba1ff1b2ad0bf2ff4246bRuben Brunk     * @see CaptureRequest#CONTROL_AWB_MODE
13120da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * @see CaptureRequest#CONTROL_MODE
1313e6679366938fd3ed197ba1ff1b2ad0bf2ff4246bRuben Brunk     * @see #CONTROL_SCENE_MODE_DISABLED
13145a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_SCENE_MODE_FACE_PRIORITY
13155a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_SCENE_MODE_ACTION
13165a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_SCENE_MODE_PORTRAIT
13175a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_SCENE_MODE_LANDSCAPE
13185a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_SCENE_MODE_NIGHT
13195a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_SCENE_MODE_NIGHT_PORTRAIT
13205a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_SCENE_MODE_THEATRE
13215a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_SCENE_MODE_BEACH
13225a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_SCENE_MODE_SNOW
13235a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_SCENE_MODE_SUNSET
13245a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_SCENE_MODE_STEADYPHOTO
13255a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_SCENE_MODE_FIREWORKS
13265a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_SCENE_MODE_SPORTS
13275a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_SCENE_MODE_PARTY
13285a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_SCENE_MODE_CANDLELIGHT
13295a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_SCENE_MODE_BARCODE
1330e040418f4779c37aa9df69a3916d376af9d2e868Zhijun He     * @see #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO
1331f4eac129545fd583d33d9e7ab05cc87f61079bb9Eino-Ville Talvala     * @see #CONTROL_SCENE_MODE_HDR
13325a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
13336c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
13345a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Integer> CONTROL_SCENE_MODE =
13355a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Integer>("android.control.sceneMode", int.class);
13365a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
13375a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
1338ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>Whether video stabilization is
1339b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * active.</p>
1340fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Video stabilization automatically translates and scales images from
1341fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * the camera in order to stabilize motion between consecutive frames.</p>
1342ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>If enabled, video stabilization can modify the
134345fa43a1815e2d0a25ed3a126e4e732a03b7ed7fZhijun He     * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to keep the video stream stabilized.</p>
1344fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Switching between different video stabilization modes may take several
1345fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * frames to initialize, the camera device will report the current mode
1346fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * in capture result metadata. For example, When "ON" mode is requested,
1347fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * the video stabilization modes in the first several capture results may
1348fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * still be "OFF", and it will become "ON" when the initialization is
1349fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * done.</p>
1350fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>If a camera device supports both this mode and OIS
1351fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * ({@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}), turning both modes on may
1352fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * produce undesirable interaction, so it is recommended not to enable
1353fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * both at the same time.</p>
1354fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
1355fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
1356fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_OFF OFF}</li>
1357fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_ON ON}</li>
1358fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
13594b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
13600da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     *
136145fa43a1815e2d0a25ed3a126e4e732a03b7ed7fZhijun He     * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
13620da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * @see CaptureRequest#SCALER_CROP_REGION
13634793af5e3577c51858719a8977d300c3aafdf881Zhijun He     * @see #CONTROL_VIDEO_STABILIZATION_MODE_OFF
13644793af5e3577c51858719a8977d300c3aafdf881Zhijun He     * @see #CONTROL_VIDEO_STABILIZATION_MODE_ON
13655a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
13666c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
13674793af5e3577c51858719a8977d300c3aafdf881Zhijun He    public static final Key<Integer> CONTROL_VIDEO_STABILIZATION_MODE =
13684793af5e3577c51858719a8977d300c3aafdf881Zhijun He            new Key<Integer>("android.control.videoStabilizationMode", int.class);
13695a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
13705a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
1371ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>Operation mode for edge
1372cc28a41b48bc687002a9e1fc436d00ca6f0c3692Zhijun He     * enhancement.</p>
1373fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Edge enhancement improves sharpness and details in the captured image. OFF means
1374fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * no enhancement will be applied by the camera device.</p>
13755f2a47f3dedfc7859457067d8cdcdbfc28ee08acZhijun He     * <p>FAST/HIGH_QUALITY both mean camera device determined enhancement
13762807936f5dfdeff25e9ace3482100511a69dcf13Zhijun He     * will be applied. HIGH_QUALITY mode indicates that the
13775f2a47f3dedfc7859457067d8cdcdbfc28ee08acZhijun He     * camera device will use the highest-quality enhancement algorithms,
13785f2a47f3dedfc7859457067d8cdcdbfc28ee08acZhijun He     * even if it slows down capture rate. FAST means the camera device will
13792807936f5dfdeff25e9ace3482100511a69dcf13Zhijun He     * not slow down capture rate when applying edge enhancement.</p>
13800e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera
13810e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * device will apply FAST/HIGH_QUALITY YUV-domain edge enhancement, respectively.
13820e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * The camera device may adjust its internal noise reduction parameters for best
13830e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * image quality based on the {@link CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR android.reprocess.effectiveExposureFactor}, if it is set.</p>
1384fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
1385fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
1386fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #EDGE_MODE_OFF OFF}</li>
1387fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #EDGE_MODE_FAST FAST}</li>
1388fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #EDGE_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
1389fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
1390fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Available values for this device:</b><br>
1391fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES android.edge.availableEdgeModes}</p>
13924b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
13934b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Full capability</b> -
13944b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
13954b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
13966dc379c7bd34d9707ee2ef819a5a07afc2aa9314Ruben Brunk     *
13976dc379c7bd34d9707ee2ef819a5a07afc2aa9314Ruben Brunk     * @see CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES
13984b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
13990e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR
14005a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #EDGE_MODE_OFF
14015a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #EDGE_MODE_FAST
14025a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #EDGE_MODE_HIGH_QUALITY
14035a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
14046c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
14055a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Integer> EDGE_MODE =
14065a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Integer>("android.edge.mode", int.class);
14075a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
14085a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
140966d065a6d48cafe390c697c77b44ba5196ee0870Zhijun He     * <p>The desired mode for for the camera device's flash control.</p>
141066d065a6d48cafe390c697c77b44ba5196ee0870Zhijun He     * <p>This control is only effective when flash unit is available
1411153ac102d36df66853b523ab01763dc457972517Zhijun He     * (<code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == true</code>).</p>
141266d065a6d48cafe390c697c77b44ba5196ee0870Zhijun He     * <p>When this control is used, the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} must be set to ON or OFF.
141366d065a6d48cafe390c697c77b44ba5196ee0870Zhijun He     * Otherwise, the camera device auto-exposure related flash control (ON_AUTO_FLASH,
141466d065a6d48cafe390c697c77b44ba5196ee0870Zhijun He     * ON_ALWAYS_FLASH, or ON_AUTO_FLASH_REDEYE) will override this control.</p>
141566d065a6d48cafe390c697c77b44ba5196ee0870Zhijun He     * <p>When set to OFF, the camera device will not fire flash for this capture.</p>
141666d065a6d48cafe390c697c77b44ba5196ee0870Zhijun He     * <p>When set to SINGLE, the camera device will fire flash regardless of the camera
141766d065a6d48cafe390c697c77b44ba5196ee0870Zhijun He     * device's auto-exposure routine's result. When used in still capture case, this
1418b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * control should be used along with auto-exposure (AE) precapture metering sequence
141966d065a6d48cafe390c697c77b44ba5196ee0870Zhijun He     * ({@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}), otherwise, the image may be incorrectly exposed.</p>
142066d065a6d48cafe390c697c77b44ba5196ee0870Zhijun He     * <p>When set to TORCH, the flash will be on continuously. This mode can be used
142166d065a6d48cafe390c697c77b44ba5196ee0870Zhijun He     * for use cases such as preview, auto-focus assist, still capture, or video recording.</p>
1422ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * <p>The flash status will be reported by {@link CaptureResult#FLASH_STATE android.flash.state} in the capture result metadata.</p>
1423fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
1424fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
1425fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #FLASH_MODE_OFF OFF}</li>
1426fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #FLASH_MODE_SINGLE SINGLE}</li>
1427fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #FLASH_MODE_TORCH TORCH}</li>
1428fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
14294b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
143066d065a6d48cafe390c697c77b44ba5196ee0870Zhijun He     *
143166d065a6d48cafe390c697c77b44ba5196ee0870Zhijun He     * @see CaptureRequest#CONTROL_AE_MODE
143266d065a6d48cafe390c697c77b44ba5196ee0870Zhijun He     * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
143366d065a6d48cafe390c697c77b44ba5196ee0870Zhijun He     * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
1434ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * @see CaptureResult#FLASH_STATE
14355a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #FLASH_MODE_OFF
14365a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #FLASH_MODE_SINGLE
14375a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #FLASH_MODE_TORCH
14385a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
14396c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
14405a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Integer> FLASH_MODE =
14415a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Integer>("android.flash.mode", int.class);
14425a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
14435a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
1444fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Operational mode for hot pixel correction.</p>
1445eba1b3a843278a92611edf153faa41a01d793b25Ruben Brunk     * <p>Hotpixel correction interpolates out, or otherwise removes, pixels
1446fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * that do not accurately measure the incoming light (i.e. pixels that
1447fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * are stuck at an arbitrary value or are oversensitive).</p>
1448fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
1449fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
1450fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #HOT_PIXEL_MODE_OFF OFF}</li>
1451fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #HOT_PIXEL_MODE_FAST FAST}</li>
1452fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #HOT_PIXEL_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
1453fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
1454fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Available values for this device:</b><br>
1455fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES android.hotPixel.availableHotPixelModes}</p>
14564b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
14579d454fd6096dad310a476d50b5e7175e38cdc4eaRuben Brunk     *
14589d454fd6096dad310a476d50b5e7175e38cdc4eaRuben Brunk     * @see CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES
1459eba1b3a843278a92611edf153faa41a01d793b25Ruben Brunk     * @see #HOT_PIXEL_MODE_OFF
1460eba1b3a843278a92611edf153faa41a01d793b25Ruben Brunk     * @see #HOT_PIXEL_MODE_FAST
1461eba1b3a843278a92611edf153faa41a01d793b25Ruben Brunk     * @see #HOT_PIXEL_MODE_HIGH_QUALITY
1462eba1b3a843278a92611edf153faa41a01d793b25Ruben Brunk     */
14636c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
1464eba1b3a843278a92611edf153faa41a01d793b25Ruben Brunk    public static final Key<Integer> HOT_PIXEL_MODE =
1465eba1b3a843278a92611edf153faa41a01d793b25Ruben Brunk            new Key<Integer>("android.hotPixel.mode", int.class);
1466eba1b3a843278a92611edf153faa41a01d793b25Ruben Brunk
1467eba1b3a843278a92611edf153faa41a01d793b25Ruben Brunk    /**
1468574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     * <p>A location object to use when generating image GPS metadata.</p>
1469fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Setting a location object in a request will include the GPS coordinates of the location
1470fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * into any JPEG images captured based on the request. These coordinates can then be
1471fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * viewed by anyone who receives the JPEG image.</p>
14724b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
1473574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     */
14746c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
14756c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @SyntheticKey
1476574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk    public static final Key<android.location.Location> JPEG_GPS_LOCATION =
1477574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk            new Key<android.location.Location>("android.jpeg.gpsLocation", android.location.Location.class);
1478574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk
1479574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk    /**
1480ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>GPS coordinates to include in output JPEG
1481fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * EXIF.</p>
1482fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
1483fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * (-180 - 180], [-90,90], [-inf, inf]</p>
14844b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
1485574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     * @hide
14865a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
14875a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<double[]> JPEG_GPS_COORDINATES =
14885a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<double[]>("android.jpeg.gpsCoordinates", double[].class);
14895a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
14905a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
1491ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>32 characters describing GPS algorithm to
1492fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * include in EXIF.</p>
1493fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Units</b>: UTF-8 null-terminated string</p>
14944b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
1495574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     * @hide
14965a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
14975a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<String> JPEG_GPS_PROCESSING_METHOD =
14985a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<String>("android.jpeg.gpsProcessingMethod", String.class);
14995a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
15005a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
1501ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>Time GPS fix was made to include in
1502fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * EXIF.</p>
1503fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Units</b>: UTC in seconds since January 1, 1970</p>
15044b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
1505574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     * @hide
15065a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
15075a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Long> JPEG_GPS_TIMESTAMP =
15085a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Long>("android.jpeg.gpsTimestamp", long.class);
15095a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
15105a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
1511fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>The orientation for a JPEG image.</p>
1512fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>The clockwise rotation angle in degrees, relative to the orientation
1513fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * to the camera, that the JPEG picture needs to be rotated by, to be viewed
1514fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * upright.</p>
1515fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Camera devices may either encode this value into the JPEG EXIF header, or
1516fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * rotate the image data to match this orientation.</p>
1517fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Note that this orientation is relative to the orientation of the camera sensor, given
1518fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * by {@link CameraCharacteristics#SENSOR_ORIENTATION android.sensor.orientation}.</p>
1519fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>To translate from the device orientation given by the Android sensor APIs, the following
1520fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * sample code may be used:</p>
1521fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <pre><code>private int getJpegOrientation(CameraCharacteristics c, int deviceOrientation) {
1522fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *     if (deviceOrientation == android.view.OrientationEventListener.ORIENTATION_UNKNOWN) return 0;
1523fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *     int sensorOrientation = c.get(CameraCharacteristics.SENSOR_ORIENTATION);
1524fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *
1525fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *     // Round device orientation to a multiple of 90
1526fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *     deviceOrientation = (deviceOrientation + 45) / 90 * 90;
1527fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *
1528fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *     // Reverse device orientation for front-facing cameras
1529fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *     boolean facingFront = c.get(CameraCharacteristics.LENS_FACING) == CameraCharacteristics.LENS_FACING_FRONT;
1530fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *     if (facingFront) deviceOrientation = -deviceOrientation;
1531fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *
1532fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *     // Calculate desired JPEG orientation relative to camera orientation to make
1533fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *     // the image upright relative to the device orientation
1534fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *     int jpegOrientation = (sensorOrientation + deviceOrientation + 360) % 360;
1535fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *
1536fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *     return jpegOrientation;
1537fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * }
1538fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </code></pre>
1539fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Units</b>: Degrees in multiples of 90</p>
1540fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
1541fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * 0, 90, 180, 270</p>
15424b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
1543fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *
1544fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * @see CameraCharacteristics#SENSOR_ORIENTATION
15455a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
15466c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
15475a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Integer> JPEG_ORIENTATION =
15485a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Integer>("android.jpeg.orientation", int.class);
15495a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
15505a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
1551ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>Compression quality of the final JPEG
1552b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * image.</p>
1553e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * <p>85-95 is typical usage range.</p>
1554fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
1555fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * 1-100; larger is higher quality</p>
15564b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
15575a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
15586c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
15595a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Byte> JPEG_QUALITY =
15605a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Byte>("android.jpeg.quality", byte.class);
15615a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
15625a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
1563ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>Compression quality of JPEG
1564e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * thumbnail.</p>
1565fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
1566fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * 1-100; larger is higher quality</p>
15674b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
15685a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
15696c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
15705a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Byte> JPEG_THUMBNAIL_QUALITY =
15715a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Byte>("android.jpeg.thumbnailQuality", byte.class);
15725a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
15735a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
1574b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <p>Resolution of embedded JPEG thumbnail.</p>
15755f2a47f3dedfc7859457067d8cdcdbfc28ee08acZhijun He     * <p>When set to (0, 0) value, the JPEG EXIF will not contain thumbnail,
15765f2a47f3dedfc7859457067d8cdcdbfc28ee08acZhijun He     * but the captured JPEG will still be a valid image.</p>
1577fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>For best results, when issuing a request for a JPEG image, the thumbnail size selected
1578fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * should have the same aspect ratio as the main JPEG output.</p>
157950f7243ca068c793c8b5aca37a9e983b630c477fZhijun He     * <p>If the thumbnail image aspect ratio differs from the JPEG primary image aspect
158050f7243ca068c793c8b5aca37a9e983b630c477fZhijun He     * ratio, the camera device creates the thumbnail by cropping it from the primary image.
158150f7243ca068c793c8b5aca37a9e983b630c477fZhijun He     * For example, if the primary image has 4:3 aspect ratio, the thumbnail image has
158250f7243ca068c793c8b5aca37a9e983b630c477fZhijun He     * 16:9 aspect ratio, the primary image will be cropped vertically (letterbox) to
158350f7243ca068c793c8b5aca37a9e983b630c477fZhijun He     * generate the thumbnail image. The thumbnail image will always have a smaller Field
158450f7243ca068c793c8b5aca37a9e983b630c477fZhijun He     * Of View (FOV) than the primary image when aspect ratios differ.</p>
1585fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
1586fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES android.jpeg.availableThumbnailSizes}</p>
15874b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
1588fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *
1589fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * @see CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES
15905a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
15916c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
159272f9f0a96e4476ef231d5001cb30521ad4ce5b1eIgor Murashkin    public static final Key<android.util.Size> JPEG_THUMBNAIL_SIZE =
159372f9f0a96e4476ef231d5001cb30521ad4ce5b1eIgor Murashkin            new Key<android.util.Size>("android.jpeg.thumbnailSize", android.util.Size.class);
15945a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
15955a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
1596fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>The desired lens aperture size, as a ratio of lens focal length to the
1597fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * effective aperture diameter.</p>
1598fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Setting this value is only supported on the camera devices that have a variable
1599fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * aperture lens.</p>
1600fb46c644ceffdd476268c35c7992c4e445bde0a5Zhijun He     * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF,
1601fb46c644ceffdd476268c35c7992c4e445bde0a5Zhijun He     * this can be set along with {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
1602d8fd67931e17c66e530de5482b63863e6c4301aaEino-Ville Talvala     * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}
1603fb46c644ceffdd476268c35c7992c4e445bde0a5Zhijun He     * to achieve manual exposure control.</p>
1604fb46c644ceffdd476268c35c7992c4e445bde0a5Zhijun He     * <p>The requested aperture value may take several frames to reach the
1605fb46c644ceffdd476268c35c7992c4e445bde0a5Zhijun He     * requested value; the camera device will report the current (intermediate)
1606ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * aperture size in capture result metadata while the aperture is changing.
1607ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * While the aperture is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
1608fb46c644ceffdd476268c35c7992c4e445bde0a5Zhijun He     * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of
1609fb46c644ceffdd476268c35c7992c4e445bde0a5Zhijun He     * the ON modes, this will be overridden by the camera device
1610fb46c644ceffdd476268c35c7992c4e445bde0a5Zhijun He     * auto-exposure algorithm, the overridden values are then provided
1611fb46c644ceffdd476268c35c7992c4e445bde0a5Zhijun He     * back to the user in the corresponding result.</p>
1612fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Units</b>: The f-number (f/N)</p>
1613fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
1614fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}</p>
16154b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
16164b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Full capability</b> -
16174b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
16184b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1619fb46c644ceffdd476268c35c7992c4e445bde0a5Zhijun He     *
1620399f05d1e7182ef6c88d30d3b98a467b845ca7c4Zhijun He     * @see CaptureRequest#CONTROL_AE_MODE
16214b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1622265b34ce331cbe296f82ca357645312718c8d4c7Eino-Ville Talvala     * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
1623ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * @see CaptureResult#LENS_STATE
1624265b34ce331cbe296f82ca357645312718c8d4c7Eino-Ville Talvala     * @see CaptureRequest#SENSOR_EXPOSURE_TIME
1625d8fd67931e17c66e530de5482b63863e6c4301aaEino-Ville Talvala     * @see CaptureRequest#SENSOR_FRAME_DURATION
1626265b34ce331cbe296f82ca357645312718c8d4c7Eino-Ville Talvala     * @see CaptureRequest#SENSOR_SENSITIVITY
16275a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
16286c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
16295a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Float> LENS_APERTURE =
16305a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Float>("android.lens.aperture", float.class);
16315a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
16325a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
1633fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>The desired setting for the lens neutral density filter(s).</p>
1634fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>This control will not be supported on most camera devices.</p>
1635855bae407d61b5cc6629248e7692927b4dacd92fRuben Brunk     * <p>Lens filters are typically used to lower the amount of light the
1636855bae407d61b5cc6629248e7692927b4dacd92fRuben Brunk     * sensor is exposed to (measured in steps of EV). As used here, an EV
1637855bae407d61b5cc6629248e7692927b4dacd92fRuben Brunk     * step is the standard logarithmic representation, which are
1638855bae407d61b5cc6629248e7692927b4dacd92fRuben Brunk     * non-negative, and inversely proportional to the amount of light
1639855bae407d61b5cc6629248e7692927b4dacd92fRuben Brunk     * hitting the sensor.  For example, setting this to 0 would result
1640855bae407d61b5cc6629248e7692927b4dacd92fRuben Brunk     * in no reduction of the incoming light, and setting this to 2 would
1641855bae407d61b5cc6629248e7692927b4dacd92fRuben Brunk     * mean that the filter is set to reduce incoming light by two stops
1642855bae407d61b5cc6629248e7692927b4dacd92fRuben Brunk     * (allowing 1/4 of the prior amount of light to the sensor).</p>
1643ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * <p>It may take several frames before the lens filter density changes
1644ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * to the requested value. While the filter density is still changing,
1645ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
1646fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Units</b>: Exposure Value (EV)</p>
1647fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
1648fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities}</p>
16494b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
16504b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Full capability</b> -
16514b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
16524b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1653855bae407d61b5cc6629248e7692927b4dacd92fRuben Brunk     *
16544b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1655855bae407d61b5cc6629248e7692927b4dacd92fRuben Brunk     * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
1656ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * @see CaptureResult#LENS_STATE
16575a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
16586c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
16595a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Float> LENS_FILTER_DENSITY =
16605a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Float>("android.lens.filterDensity", float.class);
16615a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
16625a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
1663fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>The desired lens focal length; used for optical zoom.</p>
1664a20f4c2648d7c597e3178978d17eb5894ef2b2b9Ruben Brunk     * <p>This setting controls the physical focal length of the camera
1665a20f4c2648d7c597e3178978d17eb5894ef2b2b9Ruben Brunk     * device's lens. Changing the focal length changes the field of
1666a20f4c2648d7c597e3178978d17eb5894ef2b2b9Ruben Brunk     * view of the camera device, and is usually used for optical zoom.</p>
1667a20f4c2648d7c597e3178978d17eb5894ef2b2b9Ruben Brunk     * <p>Like {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, this
1668a20f4c2648d7c597e3178978d17eb5894ef2b2b9Ruben Brunk     * setting won't be applied instantaneously, and it may take several
1669ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * frames before the lens can change to the requested focal length.
1670a20f4c2648d7c597e3178978d17eb5894ef2b2b9Ruben Brunk     * While the focal length is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will
1671a20f4c2648d7c597e3178978d17eb5894ef2b2b9Ruben Brunk     * be set to MOVING.</p>
1672fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Optical zoom will not be supported on most devices.</p>
1673fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Units</b>: Millimeters</p>
1674fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
1675fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths}</p>
16764b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
1677a20f4c2648d7c597e3178978d17eb5894ef2b2b9Ruben Brunk     *
1678a20f4c2648d7c597e3178978d17eb5894ef2b2b9Ruben Brunk     * @see CaptureRequest#LENS_APERTURE
1679a20f4c2648d7c597e3178978d17eb5894ef2b2b9Ruben Brunk     * @see CaptureRequest#LENS_FOCUS_DISTANCE
1680fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS
1681a20f4c2648d7c597e3178978d17eb5894ef2b2b9Ruben Brunk     * @see CaptureResult#LENS_STATE
16825a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
16836c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
16845a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Float> LENS_FOCAL_LENGTH =
16855a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Float>("android.lens.focalLength", float.class);
16865a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
16875a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
1688fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Desired distance to plane of sharpest focus,
1689b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * measured from frontmost surface of the lens.</p>
1690fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>This control can be used for setting manual focus, on devices that support
1691fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * the MANUAL_SENSOR capability and have a variable-focus lens (see
1692fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance}).</p>
1693fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>A value of <code>0.0f</code> means infinity focus. The value set will be clamped to
1694fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <code>[0.0f, {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance}]</code>.</p>
1695ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * <p>Like {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}, this setting won't be applied
1696ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * instantaneously, and it may take several frames before the lens
1697ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * can move to the requested focus distance. While the lens is still moving,
1698ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
16994b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>LEGACY devices support at most setting this to <code>0.0f</code>
17004b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * for infinity focus.</p>
1701fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p>
1702fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
1703fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * &gt;= 0</p>
17044b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
17054b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Full capability</b> -
17064b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
17074b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1708ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     *
17094b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1710ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * @see CaptureRequest#LENS_FOCAL_LENGTH
1711fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
1712ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
1713ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * @see CaptureResult#LENS_STATE
17145a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
17156c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
17165a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Float> LENS_FOCUS_DISTANCE =
17175a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Float>("android.lens.focusDistance", float.class);
17185a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
17195a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
172000849b3a430ce164af2db94eeacfd46131de4be8Ruben Brunk     * <p>Sets whether the camera device uses optical image stabilization (OIS)
172100849b3a430ce164af2db94eeacfd46131de4be8Ruben Brunk     * when capturing images.</p>
1722e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * <p>OIS is used to compensate for motion blur due to small
1723e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * movements of the camera during capture. Unlike digital image
1724e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * stabilization ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), OIS
1725e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * makes use of mechanical elements to stabilize the camera
1726e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * sensor, and thus allows for longer exposure times before
1727e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * camera shake becomes apparent.</p>
172845fa43a1815e2d0a25ed3a126e4e732a03b7ed7fZhijun He     * <p>Switching between different optical stabilization modes may take several
172945fa43a1815e2d0a25ed3a126e4e732a03b7ed7fZhijun He     * frames to initialize, the camera device will report the current mode in
173045fa43a1815e2d0a25ed3a126e4e732a03b7ed7fZhijun He     * capture result metadata. For example, When "ON" mode is requested, the
173145fa43a1815e2d0a25ed3a126e4e732a03b7ed7fZhijun He     * optical stabilization modes in the first several capture results may still
173245fa43a1815e2d0a25ed3a126e4e732a03b7ed7fZhijun He     * be "OFF", and it will become "ON" when the initialization is done.</p>
1733fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>If a camera device supports both OIS and digital image stabilization
1734fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), turning both modes on may produce undesirable
1735fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * interaction, so it is recommended not to enable both at the same time.</p>
1736e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * <p>Not all devices will support OIS; see
1737e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization} for
1738e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * available controls.</p>
1739fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
1740fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
1741fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_OFF OFF}</li>
1742fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_ON ON}</li>
1743fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
1744fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Available values for this device:</b><br>
1745fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization}</p>
17464b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
17474b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Limited capability</b> -
17484b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
17494b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1750e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     *
1751e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
17524b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1753e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION
17545a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF
17555a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #LENS_OPTICAL_STABILIZATION_MODE_ON
17565a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
17576c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
17585a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE =
17595a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Integer>("android.lens.opticalStabilizationMode", int.class);
17605a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
17615a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
1762e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * <p>Mode of operation for the noise reduction algorithm.</p>
1763fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>The noise reduction algorithm attempts to improve image quality by removing
17640e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * excessive noise added by the capture process, especially in dark conditions.</p>
17650e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * <p>OFF means no noise reduction will be applied by the camera device, for both raw and
17660e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * YUV domain.</p>
17670e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * <p>MINIMAL means that only sensor raw domain basic noise reduction is enabled ,to remove
17680e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * demosaicing or other processing artifacts. For YUV_REPROCESSING, MINIMAL is same as OFF.
17690e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * This mode is optional, may not be support by all devices. The application should check
17700e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes} before using it.</p>
17715f2a47f3dedfc7859457067d8cdcdbfc28ee08acZhijun He     * <p>FAST/HIGH_QUALITY both mean camera device determined noise filtering
17725f2a47f3dedfc7859457067d8cdcdbfc28ee08acZhijun He     * will be applied. HIGH_QUALITY mode indicates that the camera device
17735f2a47f3dedfc7859457067d8cdcdbfc28ee08acZhijun He     * will use the highest-quality noise filtering algorithms,
1774e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * even if it slows down capture rate. FAST means the camera device will not
17752807936f5dfdeff25e9ace3482100511a69dcf13Zhijun He     * slow down capture rate when applying noise filtering.</p>
17760e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera device
17770e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * will apply FAST/HIGH_QUALITY YUV domain noise reduction, respectively. The camera device
17780e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * may adjust the noise reduction parameters for best image quality based on the
17790e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * {@link CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR android.reprocess.effectiveExposureFactor} if it is set.</p>
1780fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
1781fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
1782fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #NOISE_REDUCTION_MODE_OFF OFF}</li>
1783fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #NOISE_REDUCTION_MODE_FAST FAST}</li>
1784fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #NOISE_REDUCTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
17850e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     *   <li>{@link #NOISE_REDUCTION_MODE_MINIMAL MINIMAL}</li>
1786fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
1787fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Available values for this device:</b><br>
1788fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes}</p>
17894b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
17904b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Full capability</b> -
17914b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
17924b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
17936dc379c7bd34d9707ee2ef819a5a07afc2aa9314Ruben Brunk     *
17944b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
17956dc379c7bd34d9707ee2ef819a5a07afc2aa9314Ruben Brunk     * @see CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES
17960e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR
17975a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #NOISE_REDUCTION_MODE_OFF
17985a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #NOISE_REDUCTION_MODE_FAST
17995a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY
18000e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * @see #NOISE_REDUCTION_MODE_MINIMAL
18015a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
18026c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
18035a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Integer> NOISE_REDUCTION_MODE =
18045a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Integer>("android.noiseReduction.mode", int.class);
18055a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
18065a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
1807ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>An application-specified ID for the current
18085a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * request. Must be maintained unchanged in output
1809ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * frame</p>
1810fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Units</b>: arbitrary integer assigned by application</p>
1811fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
1812fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * Any int</p>
18134b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
18145a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @hide
18155a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
18165a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Integer> REQUEST_ID =
18175a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Integer>("android.request.id", int.class);
18185a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
18195a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
1820fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>The desired region of the sensor to read out for this capture.</p>
1821fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>This control can be used to implement digital zoom.</p>
1822b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <p>The crop region coordinate system is based off
1823b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being the
1824b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * top-left corner of the sensor active array.</p>
1825b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <p>Output streams use this rectangle to produce their output,
1826b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * cropping to a smaller region if necessary to maintain the
1827b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * stream's aspect ratio, then scaling the sensor input to
1828b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * match the output's configured resolution.</p>
1829b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <p>The crop region is applied after the RAW to other color
1830b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * space (e.g. YUV) conversion. Since raw streams
1831b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * (e.g. RAW16) don't have the conversion stage, they are not
1832b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * croppable. The crop region will be ignored by raw streams.</p>
18339e6d1880c288d7d0ddcb651dda88d069f058ecedZhijun He     * <p>For non-raw streams, any additional per-stream cropping will
18349e6d1880c288d7d0ddcb651dda88d069f058ecedZhijun He     * be done to maximize the final pixel area of the stream.</p>
1835ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>For example, if the crop region is set to a 4:3 aspect
1836b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * ratio, then 4:3 streams will use the exact crop
1837b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * region. 16:9 streams will further crop vertically
1838ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * (letterbox).</p>
1839ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>Conversely, if the crop region is set to a 16:9, then 4:3
1840b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * outputs will crop horizontally (pillarbox), and 16:9
1841b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * streams will match exactly. These additional crops will
1842ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * be centered within the crop region.</p>
1843b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <p>The width and height of the crop region cannot
1844b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * be set to be smaller than
1845b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <code>floor( activeArraySize.width / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code> and
1846b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <code>floor( activeArraySize.height / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code>, respectively.</p>
1847b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <p>The camera device may adjust the crop region to account
1848b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * for rounding and other hardware requirements; the final
1849b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * crop region used will be included in the output capture
1850b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * result.</p>
1851fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Units</b>: Pixel coordinates relative to
1852fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
18534b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
1854d8fd67931e17c66e530de5482b63863e6c4301aaEino-Ville Talvala     *
1855d8fd67931e17c66e530de5482b63863e6c4301aaEino-Ville Talvala     * @see CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM
1856b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
18575a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
18586c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
18595a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<android.graphics.Rect> SCALER_CROP_REGION =
18605a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class);
18615a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
18625a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
1863ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>Duration each pixel is exposed to
1864ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * light.</p>
1865fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>If the sensor can't expose this exact duration, it will shorten the
1866fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * duration exposed to the nearest possible value (rather than expose longer).
1867fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * The final exposure time used will be available in the output capture result.</p>
1868fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <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
1869fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * OFF; otherwise the auto-exposure algorithm will override this value.</p>
1870fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Units</b>: Nanoseconds</p>
1871fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
1872fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE android.sensor.info.exposureTimeRange}</p>
18734b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
18744b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Full capability</b> -
18754b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
18764b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
18774b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     *
1878fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * @see CaptureRequest#CONTROL_AE_MODE
1879fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * @see CaptureRequest#CONTROL_MODE
18804b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1881fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * @see CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE
18825a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
18836c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
18845a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Long> SENSOR_EXPOSURE_TIME =
18855a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Long>("android.sensor.exposureTime", long.class);
18865a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
18875a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
1888ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>Duration from start of frame exposure to
1889143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * start of next frame exposure.</p>
1890143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * <p>The maximum frame rate that can be supported by a camera subsystem is
1891143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * a function of many factors:</p>
1892143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * <ul>
1893143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * <li>Requested resolutions of output image streams</li>
1894143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * <li>Availability of binning / skipping modes on the imager</li>
1895143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * <li>The bandwidth of the imager interface</li>
1896143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * <li>The bandwidth of the various ISP processing blocks</li>
1897143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * </ul>
1898143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * <p>Since these factors can vary greatly between different ISPs and
1899143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * sensors, the camera abstraction tries to represent the bandwidth
1900143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * restrictions with as simple a model as possible.</p>
1901143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * <p>The model presented has the following characteristics:</p>
1902143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * <ul>
1903143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * <li>The image sensor is always configured to output the smallest
1904143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * resolution possible given the application's requested output stream
1905143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * sizes.  The smallest resolution is defined as being at least as large
1906143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * as the largest requested output stream size; the camera pipeline must
1907143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * never digitally upsample sensor data when the crop region covers the
1908143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * whole sensor. In general, this means that if only small output stream
1909143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * resolutions are configured, the sensor can provide a higher frame
1910143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * rate.</li>
1911143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * <li>Since any request may use any or all the currently configured
1912143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * output streams, the sensor and ISP must be configured to support
1913143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * scaling a single capture to all the streams at the same time.  This
1914143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * means the camera pipeline must be ready to produce the largest
1915143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * requested output size without any delay.  Therefore, the overall
1916143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * frame rate of a given configured stream set is governed only by the
1917143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * largest requested stream resolution.</li>
1918143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * <li>Using more than one output stream in a request does not affect the
1919143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * frame duration.</li>
1920a23ffb5f50d5bf72bde9b8fdbcbd0cea037135b3Igor Murashkin     * <li>Certain format-streams may need to do additional background processing
1921a23ffb5f50d5bf72bde9b8fdbcbd0cea037135b3Igor Murashkin     * before data is consumed/produced by that stream. These processors
1922a23ffb5f50d5bf72bde9b8fdbcbd0cea037135b3Igor Murashkin     * can run concurrently to the rest of the camera pipeline, but
1923a23ffb5f50d5bf72bde9b8fdbcbd0cea037135b3Igor Murashkin     * cannot process more than 1 capture at a time.</li>
1924143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * </ul>
1925143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * <p>The necessary information for the application, given the model above,
19269c595174ccaaf3d36315c4a100e47ee4369073f6Igor Murashkin     * is provided via the {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} field
19279c595174ccaaf3d36315c4a100e47ee4369073f6Igor Murashkin     * using StreamConfigurationMap#getOutputMinFrameDuration(int, Size).
1928143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * These are used to determine the maximum frame rate / minimum frame
1929143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * duration that is possible for a given stream configuration.</p>
1930143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * <p>Specifically, the application can use the following rules to
1931a23ffb5f50d5bf72bde9b8fdbcbd0cea037135b3Igor Murashkin     * determine the minimum frame duration it can request from the camera
1932143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * device:</p>
1933143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * <ol>
1934a23ffb5f50d5bf72bde9b8fdbcbd0cea037135b3Igor Murashkin     * <li>Let the set of currently configured input/output streams
1935a23ffb5f50d5bf72bde9b8fdbcbd0cea037135b3Igor Murashkin     * be called <code>S</code>.</li>
1936a23ffb5f50d5bf72bde9b8fdbcbd0cea037135b3Igor Murashkin     * <li>Find the minimum frame durations for each stream in <code>S</code>, by
19379c595174ccaaf3d36315c4a100e47ee4369073f6Igor Murashkin     * looking it up in {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} using
19389c595174ccaaf3d36315c4a100e47ee4369073f6Igor Murashkin     * StreamConfigurationMap#getOutputMinFrameDuration(int, Size) (with
1939a23ffb5f50d5bf72bde9b8fdbcbd0cea037135b3Igor Murashkin     * its respective size/format). Let this set of frame durations be called
1940a23ffb5f50d5bf72bde9b8fdbcbd0cea037135b3Igor Murashkin     * <code>F</code>.</li>
1941a23ffb5f50d5bf72bde9b8fdbcbd0cea037135b3Igor Murashkin     * <li>For any given request <code>R</code>, the minimum frame duration allowed
1942a23ffb5f50d5bf72bde9b8fdbcbd0cea037135b3Igor Murashkin     * for <code>R</code> is the maximum out of all values in <code>F</code>. Let the streams
1943a23ffb5f50d5bf72bde9b8fdbcbd0cea037135b3Igor Murashkin     * used in <code>R</code> be called <code>S_r</code>.</li>
1944143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * </ol>
1945a23ffb5f50d5bf72bde9b8fdbcbd0cea037135b3Igor Murashkin     * <p>If none of the streams in <code>S_r</code> have a stall time (listed in
19469c595174ccaaf3d36315c4a100e47ee4369073f6Igor Murashkin     * StreamConfigurationMap#getOutputStallDuration(int,Size) using its
19479c595174ccaaf3d36315c4a100e47ee4369073f6Igor Murashkin     * respective size/format), then the frame duration in
1948a23ffb5f50d5bf72bde9b8fdbcbd0cea037135b3Igor Murashkin     * <code>F</code> determines the steady state frame rate that the application will
1949a23ffb5f50d5bf72bde9b8fdbcbd0cea037135b3Igor Murashkin     * get if it uses <code>R</code> as a repeating request. Let this special kind
1950a23ffb5f50d5bf72bde9b8fdbcbd0cea037135b3Igor Murashkin     * of request be called <code>Rsimple</code>.</p>
1951a23ffb5f50d5bf72bde9b8fdbcbd0cea037135b3Igor Murashkin     * <p>A repeating request <code>Rsimple</code> can be <em>occasionally</em> interleaved
1952a23ffb5f50d5bf72bde9b8fdbcbd0cea037135b3Igor Murashkin     * by a single capture of a new request <code>Rstall</code> (which has at least
1953a23ffb5f50d5bf72bde9b8fdbcbd0cea037135b3Igor Murashkin     * one in-use stream with a non-0 stall time) and if <code>Rstall</code> has the
1954a23ffb5f50d5bf72bde9b8fdbcbd0cea037135b3Igor Murashkin     * same minimum frame duration this will not cause a frame rate loss
1955a23ffb5f50d5bf72bde9b8fdbcbd0cea037135b3Igor Murashkin     * if all buffers from the previous <code>Rstall</code> have already been
1956a23ffb5f50d5bf72bde9b8fdbcbd0cea037135b3Igor Murashkin     * delivered.</p>
1957a23ffb5f50d5bf72bde9b8fdbcbd0cea037135b3Igor Murashkin     * <p>For more details about stalling, see
19589c595174ccaaf3d36315c4a100e47ee4369073f6Igor Murashkin     * StreamConfigurationMap#getOutputStallDuration(int,Size).</p>
1959fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <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
1960fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * OFF; otherwise the auto-exposure algorithm will override this value.</p>
1961fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Units</b>: Nanoseconds</p>
1962fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
1963fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * See {@link CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION android.sensor.info.maxFrameDuration},
1964fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}. The duration
1965fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * is capped to <code>max(duration, exposureTime + overhead)</code>.</p>
19664b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
19674b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Full capability</b> -
19684b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
19694b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1970143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     *
1971fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * @see CaptureRequest#CONTROL_AE_MODE
1972fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * @see CaptureRequest#CONTROL_MODE
19734b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
19749c595174ccaaf3d36315c4a100e47ee4369073f6Igor Murashkin     * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
1975fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * @see CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION
19765a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
19776c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
19785a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Long> SENSOR_FRAME_DURATION =
19795a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Long>("android.sensor.frameDuration", long.class);
19805a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
19815a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
1982b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <p>The amount of gain applied to sensor data
1983b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * before processing.</p>
1984b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <p>The sensitivity is the standard ISO sensitivity value,
1985b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * as defined in ISO 12232:2006.</p>
1986b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <p>The sensitivity must be within {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}, and
1987b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * if if it less than {@link CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY android.sensor.maxAnalogSensitivity}, the camera device
1988b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * is guaranteed to use only analog amplification for applying the gain.</p>
1989b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <p>If the camera device cannot apply the exact sensitivity
1990b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * requested, it will reduce the gain to the nearest supported
1991b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * value. The final sensitivity used will be available in the
1992b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * output capture result.</p>
1993fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Units</b>: ISO arithmetic units</p>
1994fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
1995fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}</p>
19964b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
19974b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Full capability</b> -
19984b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
19994b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2000b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     *
20014b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2002b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * @see CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE
2003b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * @see CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY
20045a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
20056c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
20065a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Integer> SENSOR_SENSITIVITY =
20075a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Integer>("android.sensor.sensitivity", int.class);
20085a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
20095a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
2010c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * <p>A pixel <code>[R, G_even, G_odd, B]</code> that supplies the test pattern
2011c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * when {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode} is SOLID_COLOR.</p>
2012c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * <p>Each color channel is treated as an unsigned 32-bit integer.
2013c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * The camera device then uses the most significant X bits
2014c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * that correspond to how many bits are in its Bayer raw sensor
2015c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * output.</p>
2016c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * <p>For example, a sensor with RAW10 Bayer output would use the
2017c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * 10 most significant bits from each color channel.</p>
2018c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2019c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     *
2020c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
2021c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     */
20226c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
2023c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin    public static final Key<int[]> SENSOR_TEST_PATTERN_DATA =
2024c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin            new Key<int[]>("android.sensor.testPatternData", int[].class);
2025c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin
2026c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin    /**
2027c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * <p>When enabled, the sensor sends a test pattern instead of
2028c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * doing a real exposure from the camera.</p>
2029c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * <p>When a test pattern is enabled, all manual sensor controls specified
2030e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * by android.sensor.* will be ignored. All other controls should
2031c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * work as normal.</p>
2032c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * <p>For example, if manual flash is enabled, flash firing should still
2033c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * occur (and that the test pattern remain unmodified, since the flash
2034c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * would not actually affect it).</p>
2035fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Defaults to OFF.</p>
2036fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
2037fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
2038fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #SENSOR_TEST_PATTERN_MODE_OFF OFF}</li>
2039fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR SOLID_COLOR}</li>
2040fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS COLOR_BARS}</li>
2041fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY COLOR_BARS_FADE_TO_GRAY}</li>
2042fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #SENSOR_TEST_PATTERN_MODE_PN9 PN9}</li>
2043fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #SENSOR_TEST_PATTERN_MODE_CUSTOM1 CUSTOM1}</li>
2044fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
2045fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Available values for this device:</b><br>
2046fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES android.sensor.availableTestPatternModes}</p>
2047c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2048fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *
2049fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * @see CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES
2050c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * @see #SENSOR_TEST_PATTERN_MODE_OFF
2051c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * @see #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR
2052c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS
2053c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY
2054c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * @see #SENSOR_TEST_PATTERN_MODE_PN9
2055c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * @see #SENSOR_TEST_PATTERN_MODE_CUSTOM1
2056c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     */
20576c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
2058c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin    public static final Key<Integer> SENSOR_TEST_PATTERN_MODE =
2059c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin            new Key<Integer>("android.sensor.testPatternMode", int.class);
2060c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin
2061c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin    /**
2062ba93fe6468ef14865ec341bc14fc4a1dc7e88704Zhijun He     * <p>Quality of lens shading correction applied
2063ba93fe6468ef14865ec341bc14fc4a1dc7e88704Zhijun He     * to the image data.</p>
2064ba93fe6468ef14865ec341bc14fc4a1dc7e88704Zhijun He     * <p>When set to OFF mode, no lens shading correction will be applied by the
2065ba93fe6468ef14865ec341bc14fc4a1dc7e88704Zhijun He     * camera device, and an identity lens shading map data will be provided
2066ba93fe6468ef14865ec341bc14fc4a1dc7e88704Zhijun He     * if <code>{@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} == ON</code>. For example, for lens
2067fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * shading map with size of <code>[ 4, 3 ]</code>,
2068fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * the output {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap} for this case will be an identity
2069fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * map shown below:</p>
2070ba93fe6468ef14865ec341bc14fc4a1dc7e88704Zhijun He     * <pre><code>[ 1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
2071fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *  1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
2072fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *  1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
2073fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *  1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
2074fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *  1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
2075fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *  1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0 ]
2076ba93fe6468ef14865ec341bc14fc4a1dc7e88704Zhijun He     * </code></pre>
2077fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>When set to other modes, lens shading correction will be applied by the camera
2078fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * device. Applications can request lens shading map data by setting
2079fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} to ON, and then the camera device will provide lens
2080fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * shading map data in {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap}; the returned shading map
2081fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * data will be the one applied by the camera device for this capture request.</p>
2082fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>The shading map data may depend on the auto-exposure (AE) and AWB statistics, therefore
2083fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * the reliability of the map data may be affected by the AE and AWB algorithms. When AE and
2084fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * 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>
2085fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * OFF), to get best results, it is recommended that the applications wait for the AE and AWB
2086fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * to be converged before using the returned shading map data.</p>
2087fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
2088fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
2089fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #SHADING_MODE_OFF OFF}</li>
2090fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #SHADING_MODE_FAST FAST}</li>
2091fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #SHADING_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
2092fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
2093e4aa2831ce6a07a6454ebd61675d9ac432f8f492Yin-Chia Yeh     * <p><b>Available values for this device:</b><br>
2094e4aa2831ce6a07a6454ebd61675d9ac432f8f492Yin-Chia Yeh     * {@link CameraCharacteristics#SHADING_AVAILABLE_MODES android.shading.availableModes}</p>
20954b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
20964b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Full capability</b> -
20974b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
20984b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2099ba93fe6468ef14865ec341bc14fc4a1dc7e88704Zhijun He     *
2100fa7c755a920dc0209efa15a65bfdd2881cb42141Zhijun He     * @see CaptureRequest#CONTROL_AE_MODE
2101fa7c755a920dc0209efa15a65bfdd2881cb42141Zhijun He     * @see CaptureRequest#CONTROL_AWB_MODE
21024b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2103e4aa2831ce6a07a6454ebd61675d9ac432f8f492Yin-Chia Yeh     * @see CameraCharacteristics#SHADING_AVAILABLE_MODES
2104fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * @see CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP
2105ba93fe6468ef14865ec341bc14fc4a1dc7e88704Zhijun He     * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
2106ba93fe6468ef14865ec341bc14fc4a1dc7e88704Zhijun He     * @see #SHADING_MODE_OFF
2107ba93fe6468ef14865ec341bc14fc4a1dc7e88704Zhijun He     * @see #SHADING_MODE_FAST
2108ba93fe6468ef14865ec341bc14fc4a1dc7e88704Zhijun He     * @see #SHADING_MODE_HIGH_QUALITY
2109ba93fe6468ef14865ec341bc14fc4a1dc7e88704Zhijun He     */
21106c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
2111ba93fe6468ef14865ec341bc14fc4a1dc7e88704Zhijun He    public static final Key<Integer> SHADING_MODE =
2112ba93fe6468ef14865ec341bc14fc4a1dc7e88704Zhijun He            new Key<Integer>("android.shading.mode", int.class);
2113ba93fe6468ef14865ec341bc14fc4a1dc7e88704Zhijun He
2114ba93fe6468ef14865ec341bc14fc4a1dc7e88704Zhijun He    /**
2115fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Operating mode for the face detector
2116b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * unit.</p>
2117ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>Whether face detection is enabled, and whether it
21185a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * should output just the basic fields or the full set of
2119fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * fields.</p>
2120fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
2121fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
2122fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #STATISTICS_FACE_DETECT_MODE_OFF OFF}</li>
2123fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #STATISTICS_FACE_DETECT_MODE_SIMPLE SIMPLE}</li>
2124fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #STATISTICS_FACE_DETECT_MODE_FULL FULL}</li>
2125fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
2126fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Available values for this device:</b><br>
2127fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}</p>
2128fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>This key is available on all devices.</p>
21290da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     *
21300da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES
21315a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #STATISTICS_FACE_DETECT_MODE_OFF
21325a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE
21335a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #STATISTICS_FACE_DETECT_MODE_FULL
21345a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
21356c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
21365a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Integer> STATISTICS_FACE_DETECT_MODE =
21375a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Integer>("android.statistics.faceDetectMode", int.class);
21385a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
21395a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
2140fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Operating mode for hot pixel map generation.</p>
2141fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>If set to <code>true</code>, a hot pixel map is returned in {@link CaptureResult#STATISTICS_HOT_PIXEL_MAP android.statistics.hotPixelMap}.
2142fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * If set to <code>false</code>, no hot pixel map will be returned.</p>
2143fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
2144fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES android.statistics.info.availableHotPixelMapModes}</p>
21454b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
21469d454fd6096dad310a476d50b5e7175e38cdc4eaRuben Brunk     *
21479d454fd6096dad310a476d50b5e7175e38cdc4eaRuben Brunk     * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP
21489d454fd6096dad310a476d50b5e7175e38cdc4eaRuben Brunk     * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES
21499d454fd6096dad310a476d50b5e7175e38cdc4eaRuben Brunk     */
21506c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
21519d454fd6096dad310a476d50b5e7175e38cdc4eaRuben Brunk    public static final Key<Boolean> STATISTICS_HOT_PIXEL_MAP_MODE =
21529d454fd6096dad310a476d50b5e7175e38cdc4eaRuben Brunk            new Key<Boolean>("android.statistics.hotPixelMapMode", boolean.class);
21539d454fd6096dad310a476d50b5e7175e38cdc4eaRuben Brunk
21549d454fd6096dad310a476d50b5e7175e38cdc4eaRuben Brunk    /**
2155cc28a41b48bc687002a9e1fc436d00ca6f0c3692Zhijun He     * <p>Whether the camera device will output the lens
2156cc28a41b48bc687002a9e1fc436d00ca6f0c3692Zhijun He     * shading map in output result metadata.</p>
2157ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>When set to ON,
2158e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * android.statistics.lensShadingMap will be provided in
21597a9b30e9e3e45d387d2fc0cb2bd2eb79da7dd268Igor Murashkin     * the output result metadata.</p>
2160fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>ON is always supported on devices with the RAW capability.</p>
2161fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
2162fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
2163fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_OFF OFF}</li>
2164fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_ON ON}</li>
2165fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
2166e4aa2831ce6a07a6454ebd61675d9ac432f8f492Yin-Chia Yeh     * <p><b>Available values for this device:</b><br>
2167e4aa2831ce6a07a6454ebd61675d9ac432f8f492Yin-Chia Yeh     * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES android.statistics.info.availableLensShadingMapModes}</p>
21684b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
21694b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Full capability</b> -
21704b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
21714b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
21724b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     *
21734b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2174e4aa2831ce6a07a6454ebd61675d9ac432f8f492Yin-Chia Yeh     * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES
2175d96748b02a468e484f864f4e3e4b7819f7dcdbd0Eino-Ville Talvala     * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF
2176d96748b02a468e484f864f4e3e4b7819f7dcdbd0Eino-Ville Talvala     * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON
2177d96748b02a468e484f864f4e3e4b7819f7dcdbd0Eino-Ville Talvala     */
21786c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
2179d96748b02a468e484f864f4e3e4b7819f7dcdbd0Eino-Ville Talvala    public static final Key<Integer> STATISTICS_LENS_SHADING_MAP_MODE =
2180d96748b02a468e484f864f4e3e4b7819f7dcdbd0Eino-Ville Talvala            new Key<Integer>("android.statistics.lensShadingMapMode", int.class);
2181d96748b02a468e484f864f4e3e4b7819f7dcdbd0Eino-Ville Talvala
2182d96748b02a468e484f864f4e3e4b7819f7dcdbd0Eino-Ville Talvala    /**
2183ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>Tonemapping / contrast / gamma curve for the blue
2184e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2185e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * CONTRAST_CURVE.</p>
21868490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <p>See android.tonemap.curveRed for more details.</p>
21874b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
21884b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Full capability</b> -
21894b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
21904b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
21910da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     *
21924b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
21935f2a47f3dedfc7859457067d8cdcdbfc28ee08acZhijun He     * @see CaptureRequest#TONEMAP_MODE
21948490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * @hide
21955a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
21963ffd70554f85bd1ee54354f2d5c44e1bc0878227Zhijun He    public static final Key<float[]> TONEMAP_CURVE_BLUE =
21973ffd70554f85bd1ee54354f2d5c44e1bc0878227Zhijun He            new Key<float[]>("android.tonemap.curveBlue", float[].class);
21985a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
21995a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
2200ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>Tonemapping / contrast / gamma curve for the green
2201e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2202e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * CONTRAST_CURVE.</p>
22038490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <p>See android.tonemap.curveRed for more details.</p>
22044b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
22054b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Full capability</b> -
22064b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
22074b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
22080da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     *
22094b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
22105f2a47f3dedfc7859457067d8cdcdbfc28ee08acZhijun He     * @see CaptureRequest#TONEMAP_MODE
22118490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * @hide
22125a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
22133ffd70554f85bd1ee54354f2d5c44e1bc0878227Zhijun He    public static final Key<float[]> TONEMAP_CURVE_GREEN =
22143ffd70554f85bd1ee54354f2d5c44e1bc0878227Zhijun He            new Key<float[]>("android.tonemap.curveGreen", float[].class);
22155a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
22165a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
2217ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>Tonemapping / contrast / gamma curve for the red
2218e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2219e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * CONTRAST_CURVE.</p>
2220e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * <p>Each channel's curve is defined by an array of control points:</p>
22218490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <pre><code>android.tonemap.curveRed =
2222fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   [ P0in, P0out, P1in, P1out, P2in, P2out, P3in, P3out, ..., PNin, PNout ]
2223870922be2399766078d0a4e42a0158ecb9eb1f86Zhijun He     * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
2224fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>These are sorted in order of increasing <code>Pin</code>; it is
2225fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * required that input values 0.0 and 1.0 are included in the list to
2226e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * define a complete mapping. For input values between control points,
2227e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * the camera device must linearly interpolate between the control
2228e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * points.</p>
2229e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * <p>Each curve can have an independent number of points, and the number
2230e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * of points can be less than max (that is, the request doesn't have to
2231e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * always provide a curve with number of points equivalent to
2232e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
2233e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * <p>A few examples, and their corresponding graphical mappings; these
2234e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * only specify the red channel and the precision is limited to 4
2235e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * digits, for conciseness.</p>
2236e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * <p>Linear mapping:</p>
22378490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <pre><code>android.tonemap.curveRed = [ 0, 0, 1.0, 1.0 ]
2238e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * </code></pre>
2239e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p>
2240e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * <p>Invert mapping:</p>
22418490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <pre><code>android.tonemap.curveRed = [ 0, 1.0, 1.0, 0 ]
2242e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * </code></pre>
2243e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p>
2244e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
22458490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <pre><code>android.tonemap.curveRed = [
2246fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   0.0000, 0.0000, 0.0667, 0.2920, 0.1333, 0.4002, 0.2000, 0.4812,
2247fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   0.2667, 0.5484, 0.3333, 0.6069, 0.4000, 0.6594, 0.4667, 0.7072,
2248fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   0.5333, 0.7515, 0.6000, 0.7928, 0.6667, 0.8317, 0.7333, 0.8685,
2249fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   0.8000, 0.9035, 0.8667, 0.9370, 0.9333, 0.9691, 1.0000, 1.0000 ]
2250e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * </code></pre>
2251e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p>
2252e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
22538490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <pre><code>android.tonemap.curveRed = [
2254fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   0.0000, 0.0000, 0.0667, 0.2864, 0.1333, 0.4007, 0.2000, 0.4845,
2255fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   0.2667, 0.5532, 0.3333, 0.6125, 0.4000, 0.6652, 0.4667, 0.7130,
2256fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   0.5333, 0.7569, 0.6000, 0.7977, 0.6667, 0.8360, 0.7333, 0.8721,
2257fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   0.8000, 0.9063, 0.8667, 0.9389, 0.9333, 0.9701, 1.0000, 1.0000 ]
2258e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * </code></pre>
2259e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p>
2260fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
2261fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * 0-1 on both input and output coordinates, normalized
2262fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * as a floating-point value such that 0 == black and 1 == white.</p>
22634b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
22644b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Full capability</b> -
22654b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
22664b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
22670da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     *
22684b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2269e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
22700da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * @see CaptureRequest#TONEMAP_MODE
22718490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * @hide
22725a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
22735a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<float[]> TONEMAP_CURVE_RED =
22745a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<float[]>("android.tonemap.curveRed", float[].class);
22755a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
22765a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
22778490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <p>Tonemapping / contrast / gamma curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode}
22788490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * is CONTRAST_CURVE.</p>
22798490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <p>The tonemapCurve consist of three curves for each of red, green, and blue
22808490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * channels respectively. The following example uses the red channel as an
22818490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * example. The same logic applies to green and blue channel.
22828490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * Each channel's curve is defined by an array of control points:</p>
22838490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <pre><code>curveRed =
2284fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   [ P0(in, out), P1(in, out), P2(in, out), P3(in, out), ..., PN(in, out) ]
22858490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
22868490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <p>These are sorted in order of increasing <code>Pin</code>; it is always
22878490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * guaranteed that input values 0.0 and 1.0 are included in the list to
22888490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * define a complete mapping. For input values between control points,
22898490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * the camera device must linearly interpolate between the control
22908490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * points.</p>
22918490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <p>Each curve can have an independent number of points, and the number
22928490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * of points can be less than max (that is, the request doesn't have to
22938490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * always provide a curve with number of points equivalent to
22948490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
22958490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <p>A few examples, and their corresponding graphical mappings; these
22968490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * only specify the red channel and the precision is limited to 4
22978490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * digits, for conciseness.</p>
22988490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <p>Linear mapping:</p>
22998490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <pre><code>curveRed = [ (0, 0), (1.0, 1.0) ]
23008490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * </code></pre>
23018490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p>
23028490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <p>Invert mapping:</p>
23038490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <pre><code>curveRed = [ (0, 1.0), (1.0, 0) ]
23048490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * </code></pre>
23058490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p>
23068490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
23078490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <pre><code>curveRed = [
2308fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   (0.0000, 0.0000), (0.0667, 0.2920), (0.1333, 0.4002), (0.2000, 0.4812),
2309fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   (0.2667, 0.5484), (0.3333, 0.6069), (0.4000, 0.6594), (0.4667, 0.7072),
2310fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   (0.5333, 0.7515), (0.6000, 0.7928), (0.6667, 0.8317), (0.7333, 0.8685),
2311fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   (0.8000, 0.9035), (0.8667, 0.9370), (0.9333, 0.9691), (1.0000, 1.0000) ]
23128490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * </code></pre>
23138490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p>
23148490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
23158490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <pre><code>curveRed = [
2316fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   (0.0000, 0.0000), (0.0667, 0.2864), (0.1333, 0.4007), (0.2000, 0.4845),
2317fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   (0.2667, 0.5532), (0.3333, 0.6125), (0.4000, 0.6652), (0.4667, 0.7130),
2318fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   (0.5333, 0.7569), (0.6000, 0.7977), (0.6667, 0.8360), (0.7333, 0.8721),
2319fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   (0.8000, 0.9063), (0.8667, 0.9389), (0.9333, 0.9701), (1.0000, 1.0000) ]
23208490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * </code></pre>
23218490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p>
23224b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
23234b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Full capability</b> -
23244b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
23254b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
23268490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     *
23274b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
23288490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
23298490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * @see CaptureRequest#TONEMAP_MODE
23308490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     */
23316c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
23326c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @SyntheticKey
23338490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh    public static final Key<android.hardware.camera2.params.TonemapCurve> TONEMAP_CURVE =
23348490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh            new Key<android.hardware.camera2.params.TonemapCurve>("android.tonemap.curve", android.hardware.camera2.params.TonemapCurve.class);
23358490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh
23368490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh    /**
2337e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * <p>High-level global contrast/gamma/tonemapping control.</p>
2338e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * <p>When switching to an application-defined contrast curve by setting
2339e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} to CONTRAST_CURVE, the curve is defined
2340e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * per-channel with a set of <code>(in, out)</code> points that specify the
2341e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * mapping from input high-bit-depth pixel value to the output
2342e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * low-bit-depth value.  Since the actual pixel ranges of both input
2343e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * and output may change depending on the camera pipeline, the values
2344e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * are specified by normalized floating-point numbers.</p>
2345e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * <p>More-complex color mapping operations such as 3D color look-up
2346e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * tables, selective chroma enhancement, or other non-linear color
2347e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * transforms will be disabled when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
2348e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * CONTRAST_CURVE.</p>
2349e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * <p>When using either FAST or HIGH_QUALITY, the camera device will
23508490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * emit its own tonemap curve in {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}.
2351e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * These values are always available, and as close as possible to the
2352e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * actually used nonlinear/nonglobal transforms.</p>
2353fa7c755a920dc0209efa15a65bfdd2881cb42141Zhijun He     * <p>If a request is sent with CONTRAST_CURVE with the camera device's
2354e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * provided curve in FAST or HIGH_QUALITY, the image's tonemap will be
2355e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * roughly the same.</p>
2356fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
2357fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
2358fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #TONEMAP_MODE_CONTRAST_CURVE CONTRAST_CURVE}</li>
2359fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #TONEMAP_MODE_FAST FAST}</li>
2360fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #TONEMAP_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
2361fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
2362fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Available values for this device:</b><br>
2363fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES android.tonemap.availableToneMapModes}</p>
23644b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
23654b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Full capability</b> -
23664b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
23674b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
23683242f4fb19b77bcd2435cbe710188d012d08b005Igor Murashkin     *
23694b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
23706dc379c7bd34d9707ee2ef819a5a07afc2aa9314Ruben Brunk     * @see CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES
23718490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * @see CaptureRequest#TONEMAP_CURVE
2372e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * @see CaptureRequest#TONEMAP_MODE
23735a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #TONEMAP_MODE_CONTRAST_CURVE
23745a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #TONEMAP_MODE_FAST
23755a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #TONEMAP_MODE_HIGH_QUALITY
23765a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
23776c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
23785a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Integer> TONEMAP_MODE =
23795a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Integer>("android.tonemap.mode", int.class);
23805a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
23815a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
2382ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>This LED is nominally used to indicate to the user
23835a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * that the camera is powered on and may be streaming images back to the
23845a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * Application Processor. In certain rare circumstances, the OS may
23855a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * disable this when video is processed locally and not transmitted to
2386ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * any untrusted applications.</p>
2387ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>In particular, the LED <em>must</em> always be on when the data could be
2388ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * transmitted off the device. The LED <em>should</em> always be on whenever
2389ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * data is stored locally on the device.</p>
2390ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>The LED <em>may</em> be off if a trusted application is using the data that
2391ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * doesn't violate the above rules.</p>
23924b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
23935a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @hide
23945a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
23955a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Boolean> LED_TRANSMIT =
23965a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Boolean>("android.led.transmit", boolean.class);
23975a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
23985a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
2399ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>Whether black-level compensation is locked
24000956af56a294397325f2695604229ab7550364caEino-Ville Talvala     * to its current values, or is free to vary.</p>
2401fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>When set to <code>true</code> (ON), the values used for black-level
24020956af56a294397325f2695604229ab7550364caEino-Ville Talvala     * compensation will not change until the lock is set to
2403fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <code>false</code> (OFF).</p>
2404ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>Since changes to certain capture parameters (such as
24055a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * exposure time) may require resetting of black level
24060956af56a294397325f2695604229ab7550364caEino-Ville Talvala     * compensation, the camera device must report whether setting
24070956af56a294397325f2695604229ab7550364caEino-Ville Talvala     * the black level lock was successful in the output result
2408ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * metadata.</p>
2409ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>For example, if a sequence of requests is as follows:</p>
2410ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <ul>
2411ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <li>Request 1: Exposure = 10ms, Black level lock = OFF</li>
2412ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <li>Request 2: Exposure = 10ms, Black level lock = ON</li>
2413ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <li>Request 3: Exposure = 10ms, Black level lock = ON</li>
2414ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <li>Request 4: Exposure = 20ms, Black level lock = ON</li>
2415ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <li>Request 5: Exposure = 20ms, Black level lock = ON</li>
2416ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <li>Request 6: Exposure = 20ms, Black level lock = ON</li>
2417ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * </ul>
24180956af56a294397325f2695604229ab7550364caEino-Ville Talvala     * <p>And the exposure change in Request 4 requires the camera
24190956af56a294397325f2695604229ab7550364caEino-Ville Talvala     * device to reset the black level offsets, then the output
24200956af56a294397325f2695604229ab7550364caEino-Ville Talvala     * result metadata is expected to be:</p>
2421ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <ul>
2422ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <li>Result 1: Exposure = 10ms, Black level lock = OFF</li>
2423ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <li>Result 2: Exposure = 10ms, Black level lock = ON</li>
2424ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <li>Result 3: Exposure = 10ms, Black level lock = ON</li>
2425ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <li>Result 4: Exposure = 20ms, Black level lock = OFF</li>
2426ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <li>Result 5: Exposure = 20ms, Black level lock = ON</li>
2427ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <li>Result 6: Exposure = 20ms, Black level lock = ON</li>
2428ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * </ul>
24290956af56a294397325f2695604229ab7550364caEino-Ville Talvala     * <p>This indicates to the application that on frame 4, black
24300956af56a294397325f2695604229ab7550364caEino-Ville Talvala     * levels were reset due to exposure value changes, and pixel
24310956af56a294397325f2695604229ab7550364caEino-Ville Talvala     * values may not be consistent across captures.</p>
24320956af56a294397325f2695604229ab7550364caEino-Ville Talvala     * <p>The camera device will maintain the lock to the extent
24330956af56a294397325f2695604229ab7550364caEino-Ville Talvala     * possible, only overriding the lock to OFF when changes to
24340956af56a294397325f2695604229ab7550364caEino-Ville Talvala     * other request parameters require a black level recalculation
24350956af56a294397325f2695604229ab7550364caEino-Ville Talvala     * or reset.</p>
24364b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
24374b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Full capability</b> -
24384b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
24394b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
24404b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     *
24414b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
24425a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
24436c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
24445a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Boolean> BLACK_LEVEL_LOCK =
24455a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Boolean>("android.blackLevel.lock", boolean.class);
24465a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
24470e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He    /**
24480e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * <p>The amount of exposure time increase factor applied to the original output
24490e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * frame by the application processing before sending for reprocessing.</p>
24500e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * <p>This is optional, and will be supported if the camera device supports YUV_REPROCESSING
24510e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains YUV_REPROCESSING).</p>
24520e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * <p>For some YUV reprocessing use cases, the application may choose to filter the original
24530e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * output frames to effectively reduce the noise to the same level as a frame that was
24540e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * captured with longer exposure time. To be more specific, assuming the original captured
24550e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * images were captured with a sensitivity of S and an exposure time of T, the model in
24560e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * the camera device is that the amount of noise in the image would be approximately what
24570e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * would be expected if the original capture parameters had been a sensitivity of
24580e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * S/effectiveExposureFactor and an exposure time of T*effectiveExposureFactor, rather
24590e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * than S and T respectively. If the captured images were processed by the application
24600e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * before being sent for reprocessing, then the application may have used image processing
24610e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * algorithms and/or multi-frame image fusion to reduce the noise in the
24620e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * application-processed images (input images). By using the effectiveExposureFactor
24630e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * control, the application can communicate to the camera device the actual noise level
24640e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * improvement in the application-processed image. With this information, the camera
24650e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * device can select appropriate noise reduction and edge enhancement parameters to avoid
24660e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * excessive noise reduction ({@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode}) and insufficient edge
24670e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * enhancement ({@link CaptureRequest#EDGE_MODE android.edge.mode}) being applied to the reprocessed frames.</p>
24680e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * <p>For example, for multi-frame image fusion use case, the application may fuse
24690e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * multiple output frames together to a final frame for reprocessing. When N image are
24700e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * fused into 1 image for reprocessing, the exposure time increase factor could be up to
24710e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * square root of N (based on a simple photon shot noise model). The camera device will
24720e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * adjust the reprocessing noise reduction and edge enhancement parameters accordingly to
24730e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * produce the best quality images.</p>
24740e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * <p>This is relative factor, 1.0 indicates the application hasn't processed the input
24750e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * buffer in a way that affects its effective exposure time.</p>
24760e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * <p>This control is only effective for YUV reprocessing capture request. For noise
24770e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * reduction reprocessing, it is only effective when <code>{@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode} != OFF</code>.
24780e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * Similarly, for edge enhancement reprocessing, it is only effective when
24790e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * <code>{@link CaptureRequest#EDGE_MODE android.edge.mode} != OFF</code>.</p>
24800e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * <p><b>Units</b>: Relative exposure time increase factor.</p>
24810e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * <p><b>Range of valid values:</b><br>
24820e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * &gt;= 1.0</p>
24830e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
24840e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     *
24850e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * @see CaptureRequest#EDGE_MODE
24860e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * @see CaptureRequest#NOISE_REDUCTION_MODE
24870e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
24880e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     */
24890e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He    @PublicKey
24900e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He    public static final Key<Float> REPROCESS_EFFECTIVE_EXPOSURE_FACTOR =
24910e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He            new Key<Float>("android.reprocess.effectiveExposureFactor", float.class);
24920e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He
24935a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
24945a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * End generated code
24955a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
24966c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin
24974b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin
24984b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin
24995a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala}
2500