1b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala/*
2b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala * Copyright (C) 2012 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
198b905578b54041f7d0b8dc04dd158d16d28262a1Eino-Ville Talvalaimport android.annotation.NonNull;
208b905578b54041f7d0b8dc04dd158d16d28262a1Eino-Ville Talvalaimport android.annotation.Nullable;
2170c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvalaimport android.hardware.camera2.impl.CameraMetadataNative;
22bdf366cc70639b0e16b8f84eebe612a48a8b8b06Igor Murashkinimport android.hardware.camera2.impl.CaptureResultExtras;
236c76f58f31635c19c14ae161f96dad2082537860Igor Murashkinimport android.hardware.camera2.impl.PublicKey;
246c76f58f31635c19c14ae161f96dad2082537860Igor Murashkinimport android.hardware.camera2.impl.SyntheticKey;
25d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkinimport android.hardware.camera2.utils.TypeReference;
26d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkinimport android.util.Log;
2772f9f0a96e4476ef231d5001cb30521ad4ce5b1eIgor Murashkinimport android.util.Rational;
28b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala
29d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkinimport java.util.List;
30d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin
31b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala/**
32db075afc85b6b50a5d3a988a17ed0d4e09ef0823Igor Murashkin * <p>The subset of the results of a single image capture from the image sensor.</p>
33b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala *
34db075afc85b6b50a5d3a988a17ed0d4e09ef0823Igor Murashkin * <p>Contains a subset of the final configuration for the capture hardware (sensor, lens,
35b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala * flash), the processing pipeline, the control algorithms, and the output
36b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala * buffers.</p>
37b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala *
38b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala * <p>CaptureResults are produced by a {@link CameraDevice} after processing a
39b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala * {@link CaptureRequest}. All properties listed for capture requests can also
40b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala * be queried on the capture result, to determine the final values used for
41b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala * capture. The result also includes additional metadata about the state of the
42b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala * camera device during the capture.</p>
43b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala *
44db075afc85b6b50a5d3a988a17ed0d4e09ef0823Igor Murashkin * <p>Not all properties returned by {@link CameraCharacteristics#getAvailableCaptureResultKeys()}
45db075afc85b6b50a5d3a988a17ed0d4e09ef0823Igor Murashkin * are necessarily available. Some results are {@link CaptureResult partial} and will
46db075afc85b6b50a5d3a988a17ed0d4e09ef0823Igor Murashkin * not have every key set. Only {@link TotalCaptureResult total} results are guaranteed to have
47db075afc85b6b50a5d3a988a17ed0d4e09ef0823Igor Murashkin * every key available that was enabled by the request.</p>
48db075afc85b6b50a5d3a988a17ed0d4e09ef0823Igor Murashkin *
49db075afc85b6b50a5d3a988a17ed0d4e09ef0823Igor Murashkin * <p>{@link CaptureResult} objects are immutable.</p>
50f967a5486a78db244624fde4c105aa5e6fa914b9Ruben Brunk *
51b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala */
52db075afc85b6b50a5d3a988a17ed0d4e09ef0823Igor Murashkinpublic class CaptureResult extends CameraMetadata<CaptureResult.Key<?>> {
53d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin
54d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    private static final String TAG = "CaptureResult";
55d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    private static final boolean VERBOSE = false;
56d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin
57d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    /**
58d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * A {@code Key} is used to do capture result field lookups with
59d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * {@link CaptureResult#get}.
60d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     *
61d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * <p>For example, to get the timestamp corresponding to the exposure of the first row:
62d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * <code><pre>
63d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * long timestamp = captureResult.get(CaptureResult.SENSOR_TIMESTAMP);
64d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * </pre></code>
65d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * </p>
66d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     *
67d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * <p>To enumerate over all possible keys for {@link CaptureResult}, see
68d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * {@link CameraCharacteristics#getAvailableCaptureResultKeys}.</p>
69d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     *
70d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * @see CaptureResult#get
71d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * @see CameraCharacteristics#getAvailableCaptureResultKeys
72d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     */
73d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    public final static class Key<T> {
74d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        private final CameraMetadataNative.Key<T> mKey;
75d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin
76d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        /**
77d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         * Visible for testing and vendor extensions only.
78d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         *
79d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         * @hide
80d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         */
81de62d84eb9dbcd43c4db3100a3cd80209b04cd2fEmilian Peev        public Key(String name, Class<T> type, long vendorId) {
82de62d84eb9dbcd43c4db3100a3cd80209b04cd2fEmilian Peev            mKey = new CameraMetadataNative.Key<T>(name, type, vendorId);
83de62d84eb9dbcd43c4db3100a3cd80209b04cd2fEmilian Peev        }
84de62d84eb9dbcd43c4db3100a3cd80209b04cd2fEmilian Peev
85de62d84eb9dbcd43c4db3100a3cd80209b04cd2fEmilian Peev        /**
86de62d84eb9dbcd43c4db3100a3cd80209b04cd2fEmilian Peev         * Visible for testing and vendor extensions only.
87de62d84eb9dbcd43c4db3100a3cd80209b04cd2fEmilian Peev         *
88de62d84eb9dbcd43c4db3100a3cd80209b04cd2fEmilian Peev         * @hide
89de62d84eb9dbcd43c4db3100a3cd80209b04cd2fEmilian Peev         */
90d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        public Key(String name, Class<T> type) {
91d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin            mKey = new CameraMetadataNative.Key<T>(name, type);
92d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        }
93d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin
94d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        /**
95d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         * Visible for testing and vendor extensions only.
96d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         *
97d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         * @hide
98d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         */
99d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        public Key(String name, TypeReference<T> typeReference) {
100d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin            mKey = new CameraMetadataNative.Key<T>(name, typeReference);
101d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        }
102d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin
103d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        /**
104d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         * Return a camelCase, period separated name formatted like:
105d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         * {@code "root.section[.subsections].name"}.
106d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         *
107d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         * <p>Built-in keys exposed by the Android SDK are always prefixed with {@code "android."};
108d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         * keys that are device/platform-specific are prefixed with {@code "com."}.</p>
109d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         *
110d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         * <p>For example, {@code CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP} would
111d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         * have a name of {@code "android.scaler.streamConfigurationMap"}; whereas a device
112d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         * specific key might look like {@code "com.google.nexus.data.private"}.</p>
113d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         *
114d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         * @return String representation of the key name
115d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         */
1168b905578b54041f7d0b8dc04dd158d16d28262a1Eino-Ville Talvala        @NonNull
117d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        public String getName() {
118d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin            return mKey.getName();
119d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        }
120d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin
121d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        /**
122de62d84eb9dbcd43c4db3100a3cd80209b04cd2fEmilian Peev         * Return vendor tag id.
123de62d84eb9dbcd43c4db3100a3cd80209b04cd2fEmilian Peev         *
124de62d84eb9dbcd43c4db3100a3cd80209b04cd2fEmilian Peev         * @hide
125de62d84eb9dbcd43c4db3100a3cd80209b04cd2fEmilian Peev         */
126de62d84eb9dbcd43c4db3100a3cd80209b04cd2fEmilian Peev        public long getVendorId() {
127de62d84eb9dbcd43c4db3100a3cd80209b04cd2fEmilian Peev            return mKey.getVendorId();
128de62d84eb9dbcd43c4db3100a3cd80209b04cd2fEmilian Peev        }
129de62d84eb9dbcd43c4db3100a3cd80209b04cd2fEmilian Peev
130de62d84eb9dbcd43c4db3100a3cd80209b04cd2fEmilian Peev        /**
131d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         * {@inheritDoc}
132d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         */
133d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        @Override
134d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        public final int hashCode() {
135d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin            return mKey.hashCode();
136d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        }
137d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin
138d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        /**
139d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         * {@inheritDoc}
140d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         */
141d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        @SuppressWarnings("unchecked")
142d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        @Override
143d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        public final boolean equals(Object o) {
144d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin            return o instanceof Key && ((Key<T>)o).mKey.equals(mKey);
145d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        }
146d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin
147d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        /**
14812a8385b7e403c6e1af6c824d3e77088242f89a7Chien-Yu Chen         * Return this {@link Key} as a string representation.
14912a8385b7e403c6e1af6c824d3e77088242f89a7Chien-Yu Chen         *
15012a8385b7e403c6e1af6c824d3e77088242f89a7Chien-Yu Chen         * <p>{@code "CaptureResult.Key(%s)"}, where {@code %s} represents
15112a8385b7e403c6e1af6c824d3e77088242f89a7Chien-Yu Chen         * the name of this key as returned by {@link #getName}.</p>
15212a8385b7e403c6e1af6c824d3e77088242f89a7Chien-Yu Chen         *
15312a8385b7e403c6e1af6c824d3e77088242f89a7Chien-Yu Chen         * @return string representation of {@link Key}
15412a8385b7e403c6e1af6c824d3e77088242f89a7Chien-Yu Chen         */
15512a8385b7e403c6e1af6c824d3e77088242f89a7Chien-Yu Chen        @NonNull
15612a8385b7e403c6e1af6c824d3e77088242f89a7Chien-Yu Chen        @Override
15712a8385b7e403c6e1af6c824d3e77088242f89a7Chien-Yu Chen        public String toString() {
15812a8385b7e403c6e1af6c824d3e77088242f89a7Chien-Yu Chen            return String.format("CaptureResult.Key(%s)", mKey.getName());
15912a8385b7e403c6e1af6c824d3e77088242f89a7Chien-Yu Chen        }
16012a8385b7e403c6e1af6c824d3e77088242f89a7Chien-Yu Chen
16112a8385b7e403c6e1af6c824d3e77088242f89a7Chien-Yu Chen        /**
162d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         * Visible for CameraMetadataNative implementation only; do not use.
163d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         *
164d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         * TODO: Make this private or remove it altogether.
165d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         *
166d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         * @hide
167d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin         */
168d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        public CameraMetadataNative.Key<T> getNativeKey() {
169d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin            return mKey;
170d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        }
171d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin
172d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        @SuppressWarnings({ "unchecked" })
173d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        /*package*/ Key(CameraMetadataNative.Key<?> nativeKey) {
174d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin            mKey = (CameraMetadataNative.Key<T>) nativeKey;
175d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        }
176d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    }
17770c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala
17870c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala    private final CameraMetadataNative mResults;
1796bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin    private final CaptureRequest mRequest;
1806bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin    private final int mSequenceId;
181bdf366cc70639b0e16b8f84eebe612a48a8b8b06Igor Murashkin    private final long mFrameNumber;
18270c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala
18370725500dcf3b666b43d50563d64705aab58d2d3Igor Murashkin    /**
18470c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala     * Takes ownership of the passed-in properties object
185bdf366cc70639b0e16b8f84eebe612a48a8b8b06Igor Murashkin     *
186bdf366cc70639b0e16b8f84eebe612a48a8b8b06Igor Murashkin     * <p>For internal use only</p>
18770725500dcf3b666b43d50563d64705aab58d2d3Igor Murashkin     * @hide
18870725500dcf3b666b43d50563d64705aab58d2d3Igor Murashkin     */
189bdf366cc70639b0e16b8f84eebe612a48a8b8b06Igor Murashkin    public CaptureResult(CameraMetadataNative results, CaptureRequest parent,
190bdf366cc70639b0e16b8f84eebe612a48a8b8b06Igor Murashkin            CaptureResultExtras extras) {
1916bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin        if (results == null) {
1926bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin            throw new IllegalArgumentException("results was null");
1936bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin        }
1946bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin
1956bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin        if (parent == null) {
1966bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin            throw new IllegalArgumentException("parent was null");
1976bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin        }
1986bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin
199bdf366cc70639b0e16b8f84eebe612a48a8b8b06Igor Murashkin        if (extras == null) {
200bdf366cc70639b0e16b8f84eebe612a48a8b8b06Igor Murashkin            throw new IllegalArgumentException("extras was null");
201bdf366cc70639b0e16b8f84eebe612a48a8b8b06Igor Murashkin        }
202bdf366cc70639b0e16b8f84eebe612a48a8b8b06Igor Murashkin
203d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        mResults = CameraMetadataNative.move(results);
204d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        if (mResults.isEmpty()) {
205d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin            throw new AssertionError("Results must not be empty");
206d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        }
207de62d84eb9dbcd43c4db3100a3cd80209b04cd2fEmilian Peev        setNativeInstance(mResults);
2086bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin        mRequest = parent;
209bdf366cc70639b0e16b8f84eebe612a48a8b8b06Igor Murashkin        mSequenceId = extras.getRequestId();
210bdf366cc70639b0e16b8f84eebe612a48a8b8b06Igor Murashkin        mFrameNumber = extras.getFrameNumber();
21170c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala    }
21270c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala
213f967a5486a78db244624fde4c105aa5e6fa914b9Ruben Brunk    /**
214f967a5486a78db244624fde4c105aa5e6fa914b9Ruben Brunk     * Returns a copy of the underlying {@link CameraMetadataNative}.
215f967a5486a78db244624fde4c105aa5e6fa914b9Ruben Brunk     * @hide
216f967a5486a78db244624fde4c105aa5e6fa914b9Ruben Brunk     */
217f967a5486a78db244624fde4c105aa5e6fa914b9Ruben Brunk    public CameraMetadataNative getNativeCopy() {
218f967a5486a78db244624fde4c105aa5e6fa914b9Ruben Brunk        return new CameraMetadataNative(mResults);
219f967a5486a78db244624fde4c105aa5e6fa914b9Ruben Brunk    }
220f967a5486a78db244624fde4c105aa5e6fa914b9Ruben Brunk
221d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    /**
222d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * Creates a request-less result.
223d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     *
224d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * <p><strong>For testing only.</strong></p>
225d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * @hide
226d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     */
227d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    public CaptureResult(CameraMetadataNative results, int sequenceId) {
228d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        if (results == null) {
229d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin            throw new IllegalArgumentException("results was null");
230d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        }
231d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin
232d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        mResults = CameraMetadataNative.move(results);
233d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        if (mResults.isEmpty()) {
234d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin            throw new AssertionError("Results must not be empty");
235d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        }
236d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin
237de62d84eb9dbcd43c4db3100a3cd80209b04cd2fEmilian Peev        setNativeInstance(mResults);
238d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        mRequest = null;
239d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        mSequenceId = sequenceId;
240bdf366cc70639b0e16b8f84eebe612a48a8b8b06Igor Murashkin        mFrameNumber = -1;
241d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    }
242d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin
243d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    /**
244d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * Get a capture result field value.
245d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     *
246d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * <p>The field definitions can be found in {@link CaptureResult}.</p>
247d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     *
248d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * <p>Querying the value for the same key more than once will return a value
249d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * which is equal to the previous queried value.</p>
250d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     *
251d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * @throws IllegalArgumentException if the key was not valid
252d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     *
253d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * @param key The result field to read.
254d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * @return The value of that key, or {@code null} if the field is not set.
255d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     */
2568b905578b54041f7d0b8dc04dd158d16d28262a1Eino-Ville Talvala    @Nullable
25770c2207c34cf0e6b3b383b1b1500ff5385aa51a6Eino-Ville Talvala    public <T> T get(Key<T> key) {
258d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        T value = mResults.get(key);
259d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        if (VERBOSE) Log.v(TAG, "#get for Key = " + key.getName() + ", returned value = " + value);
260d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        return value;
261d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    }
262d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin
263d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    /**
264d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * {@inheritDoc}
265d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * @hide
266d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     */
267d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    @SuppressWarnings("unchecked")
268d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    @Override
269d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    protected <T> T getProtected(Key<?> key) {
270d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        return (T) mResults.get(key);
271d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    }
272d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin
273d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    /**
274d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * {@inheritDoc}
275d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * @hide
276d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     */
277d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    @SuppressWarnings("unchecked")
278d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    @Override
279d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    protected Class<Key<?>> getKeyClass() {
280d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        Object thisClass = Key.class;
281d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        return (Class<Key<?>>)thisClass;
282d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    }
283d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin
284d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    /**
285d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * Dumps the native metadata contents to logcat.
286d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     *
287d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * <p>Visibility for testing/debugging only. The results will not
288d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * include any synthesized keys, as they are invisible to the native layer.</p>
289d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     *
290d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * @hide
291d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     */
292d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    public void dumpToLog() {
293d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        mResults.dumpToLog();
294d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    }
295d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin
296d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    /**
297d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     * {@inheritDoc}
298d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin     */
299d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    @Override
3008b905578b54041f7d0b8dc04dd158d16d28262a1Eino-Ville Talvala    @NonNull
301d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin    public List<Key<?>> getKeys() {
302d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        // Force the javadoc for this function to show up on the CaptureResult page
303d6d65154e55612b489aae95b60f3145f3b81f3b4Igor Murashkin        return super.getKeys();
304b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala    }
305b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala
3066bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin    /**
3076bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     * Get the request associated with this result.
3086bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     *
309db075afc85b6b50a5d3a988a17ed0d4e09ef0823Igor Murashkin     * <p>Whenever a request has been fully or partially captured, with
310fd887436bd111e4d2c7307578a51b5070025b7f2Eino-Ville Talvala     * {@link CameraCaptureSession.CaptureCallback#onCaptureCompleted} or
311fd887436bd111e4d2c7307578a51b5070025b7f2Eino-Ville Talvala     * {@link CameraCaptureSession.CaptureCallback#onCaptureProgressed}, the {@code result}'s
312db075afc85b6b50a5d3a988a17ed0d4e09ef0823Igor Murashkin     * {@code getRequest()} will return that {@code request}.
3136bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     * </p>
3146bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     *
315db075afc85b6b50a5d3a988a17ed0d4e09ef0823Igor Murashkin     * <p>For example,
316fd887436bd111e4d2c7307578a51b5070025b7f2Eino-Ville Talvala     * <code><pre>cameraDevice.capture(someRequest, new CaptureCallback() {
3176bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     *     {@literal @}Override
3186bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     *     void onCaptureCompleted(CaptureRequest myRequest, CaptureResult myResult) {
3196bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     *         assert(myResult.getRequest.equals(myRequest) == true);
3206bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     *     }
321db075afc85b6b50a5d3a988a17ed0d4e09ef0823Igor Murashkin     * }, null);
3226bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     * </code></pre>
3236bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     * </p>
3246bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     *
3256bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     * @return The request associated with this result. Never {@code null}.
3266bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     */
3278b905578b54041f7d0b8dc04dd158d16d28262a1Eino-Ville Talvala    @NonNull
3286bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin    public CaptureRequest getRequest() {
3296bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin        return mRequest;
3306bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin    }
3316bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin
3326bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin    /**
3336bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     * Get the frame number associated with this result.
3346bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     *
3356bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     * <p>Whenever a request has been processed, regardless of failure or success,
3366bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     * it gets a unique frame number assigned to its future result/failure.</p>
3376bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     *
3385398a676809faaf3c6c2875edc1907ad6b8e1c89Chien-Yu Chen     * <p>For the same type of request (capturing from the camera device or reprocessing), this
3395398a676809faaf3c6c2875edc1907ad6b8e1c89Chien-Yu Chen     * value monotonically increments, starting with 0, for every new result or failure and the
3405398a676809faaf3c6c2875edc1907ad6b8e1c89Chien-Yu Chen     * scope is the lifetime of the {@link CameraDevice}. Between different types of requests,
3415398a676809faaf3c6c2875edc1907ad6b8e1c89Chien-Yu Chen     * the frame number may not monotonically increment. For example, the frame number of a newer
3425398a676809faaf3c6c2875edc1907ad6b8e1c89Chien-Yu Chen     * reprocess result may be smaller than the frame number of an older result of capturing new
3435398a676809faaf3c6c2875edc1907ad6b8e1c89Chien-Yu Chen     * images from the camera device, but the frame number of a newer reprocess result will never be
3445398a676809faaf3c6c2875edc1907ad6b8e1c89Chien-Yu Chen     * smaller than the frame number of an older reprocess result.</p>
3456bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     *
346bdf366cc70639b0e16b8f84eebe612a48a8b8b06Igor Murashkin     * @return The frame number
3475398a676809faaf3c6c2875edc1907ad6b8e1c89Chien-Yu Chen     *
3485398a676809faaf3c6c2875edc1907ad6b8e1c89Chien-Yu Chen     * @see CameraDevice#createCaptureRequest
3495398a676809faaf3c6c2875edc1907ad6b8e1c89Chien-Yu Chen     * @see CameraDevice#createReprocessCaptureRequest
3506bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     */
351bdf366cc70639b0e16b8f84eebe612a48a8b8b06Igor Murashkin    public long getFrameNumber() {
352bdf366cc70639b0e16b8f84eebe612a48a8b8b06Igor Murashkin        return mFrameNumber;
3536bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin    }
3546bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin
3556bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin    /**
3566bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     * The sequence ID for this failure that was returned by the
3570a160acf297b583e12a9710c929c4ba9a38f7353Eino-Ville Talvala     * {@link CameraCaptureSession#capture} family of functions.
3586bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     *
3596bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     * <p>The sequence ID is a unique monotonically increasing value starting from 0,
3606bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     * incremented every time a new group of requests is submitted to the CameraDevice.</p>
3616bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     *
3626bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     * @return int The ID for the sequence of requests that this capture result is a part of
3636bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     *
364fd887436bd111e4d2c7307578a51b5070025b7f2Eino-Ville Talvala     * @see CameraDevice.CaptureCallback#onCaptureSequenceCompleted
365fd887436bd111e4d2c7307578a51b5070025b7f2Eino-Ville Talvala     * @see CameraDevice.CaptureCallback#onCaptureSequenceAborted
3666bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     */
3676bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin    public int getSequenceId() {
3686bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin        return mSequenceId;
3696bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin    }
3706bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin
3715a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
3725a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * The key entries below this point are generated from metadata
3735a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * definitions in /system/media/camera/docs. Do not modify by hand or
3745a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * modify the comment blocks at the start or end.
3755a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/
3765a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
3775a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
378379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <p>The mode control selects how the image data is converted from the
379379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * sensor's native color into linear sRGB color.</p>
380b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <p>When auto-white balance (AWB) is enabled with {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, this
381379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * control is overridden by the AWB routine. When AWB is disabled, the
382379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * application controls how the color mapping is performed.</p>
383379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <p>We define the expected processing pipeline below. For consistency
384379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * across devices, this is always the case with TRANSFORM_MATRIX.</p>
385379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <p>When either FULL or HIGH_QUALITY is used, the camera device may
386379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * do additional processing but {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
387379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} will still be provided by the
388379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * camera device (in the results) and be roughly correct.</p>
389379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <p>Switching to TRANSFORM_MATRIX and using the data provided from
390379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * FAST or HIGH_QUALITY will yield a picture with the same white point
391379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * as what was produced by the camera device in the earlier frame.</p>
392379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <p>The expected processing pipeline is as follows:</p>
393379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <p><img alt="White balance processing pipeline" src="../../../../images/camera2/metadata/android.colorCorrection.mode/processing_pipeline.png" /></p>
394379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <p>The white balance is encoded by two values, a 4-channel white-balance
395379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * gain vector (applied in the Bayer domain), and a 3x3 color transform
396379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * matrix (applied after demosaic).</p>
397379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <p>The 4-channel white-balance gains are defined as:</p>
398379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} = [ R G_even G_odd B ]
399379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * </code></pre>
400379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <p>where <code>G_even</code> is the gain for green pixels on even rows of the
401379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * output, and <code>G_odd</code> is the gain for green pixels on the odd rows.
402379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * These may be identical for a given camera device implementation; if
403379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * the camera device does not support a separate gain for even/odd green
404379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * channels, it will use the <code>G_even</code> value, and write <code>G_odd</code> equal to
405379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <code>G_even</code> in the output result metadata.</p>
406379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <p>The matrices for color transforms are defined as a 9-entry vector:</p>
407379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} = [ I0 I1 I2 I3 I4 I5 I6 I7 I8 ]
408379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * </code></pre>
409379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <p>which define a transform from input sensor colors, <code>P_in = [ r g b ]</code>,
410379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * to output linear sRGB, <code>P_out = [ r' g' b' ]</code>,</p>
411379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <p>with colors as follows:</p>
412379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <pre><code>r' = I0r + I1g + I2b
413379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * g' = I3r + I4g + I5b
414379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * b' = I6r + I7g + I8b
415379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * </code></pre>
416379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <p>Both the input and output value ranges must match. Overflow/underflow
417379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * values are clipped to fit within the range.</p>
418fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
419fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
420fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX TRANSFORM_MATRIX}</li>
421fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #COLOR_CORRECTION_MODE_FAST FAST}</li>
422fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #COLOR_CORRECTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
423fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
4244b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4254b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Full capability</b> -
4264b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4274b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
428379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     *
429379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see CaptureRequest#COLOR_CORRECTION_GAINS
430379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
431379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see CaptureRequest#CONTROL_AWB_MODE
4324b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
433379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX
434379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #COLOR_CORRECTION_MODE_FAST
435379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #COLOR_CORRECTION_MODE_HIGH_QUALITY
436379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     */
4376c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
438379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He    public static final Key<Integer> COLOR_CORRECTION_MODE =
439379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He            new Key<Integer>("android.colorCorrection.mode", int.class);
440379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He
441379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He    /**
442ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>A color transform matrix to use to transform
443b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * from sensor RGB color space to output linear sRGB color space.</p>
44449a3ca9330d213fe35280c0af78a4d21acb98234Zhijun He     * <p>This matrix is either set by the camera device when the request
4450da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or
4465a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * directly by the application in the request when the
4470da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p>
44849a3ca9330d213fe35280c0af78a4d21acb98234Zhijun He     * <p>In the latter case, the camera device may round the matrix to account
44949a3ca9330d213fe35280c0af78a4d21acb98234Zhijun He     * for precision issues; the final rounded matrix should be reported back
45049a3ca9330d213fe35280c0af78a4d21acb98234Zhijun He     * in this matrix result metadata. The transform should keep the magnitude
45149a3ca9330d213fe35280c0af78a4d21acb98234Zhijun He     * of the output color values within <code>[0, 1.0]</code> (assuming input color
45249a3ca9330d213fe35280c0af78a4d21acb98234Zhijun He     * values is within the normalized range <code>[0, 1.0]</code>), or clipping may occur.</p>
453d9fc67ce3c1498a911df39675b61b96ec1364f08Yin-Chia Yeh     * <p>The valid range of each matrix element varies on different devices, but
454d9fc67ce3c1498a911df39675b61b96ec1364f08Yin-Chia Yeh     * values within [-1.5, 3.0] are guaranteed not to be clipped.</p>
455fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Units</b>: Unitless scale factors</p>
4564b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4574b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Full capability</b> -
4584b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4594b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
4600da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     *
4610da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * @see CaptureRequest#COLOR_CORRECTION_MODE
4624b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
4635a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
4646c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
4652bb91a7a68e32530adf730deeef2fe95bad20a96Eino-Ville Talvala    public static final Key<android.hardware.camera2.params.ColorSpaceTransform> COLOR_CORRECTION_TRANSFORM =
4662bb91a7a68e32530adf730deeef2fe95bad20a96Eino-Ville Talvala            new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.colorCorrection.transform", android.hardware.camera2.params.ColorSpaceTransform.class);
4675a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
4685a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
4697d2a5c5e7350658d0da4eaf75f9380593083e969Igor Murashkin     * <p>Gains applying to Bayer raw color channels for
470cc28a41b48bc687002a9e1fc436d00ca6f0c3692Zhijun He     * white-balance.</p>
4712bb91a7a68e32530adf730deeef2fe95bad20a96Eino-Ville Talvala     * <p>These per-channel gains are either set by the camera device
4722bb91a7a68e32530adf730deeef2fe95bad20a96Eino-Ville Talvala     * when the request {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not
4732bb91a7a68e32530adf730deeef2fe95bad20a96Eino-Ville Talvala     * TRANSFORM_MATRIX, or directly by the application in the
4742bb91a7a68e32530adf730deeef2fe95bad20a96Eino-Ville Talvala     * request when the {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is
4752bb91a7a68e32530adf730deeef2fe95bad20a96Eino-Ville Talvala     * TRANSFORM_MATRIX.</p>
4762bb91a7a68e32530adf730deeef2fe95bad20a96Eino-Ville Talvala     * <p>The gains in the result metadata are the gains actually
4772bb91a7a68e32530adf730deeef2fe95bad20a96Eino-Ville Talvala     * applied by the camera device to the current frame.</p>
478d9fc67ce3c1498a911df39675b61b96ec1364f08Yin-Chia Yeh     * <p>The valid range of gains varies on different devices, but gains
479d9fc67ce3c1498a911df39675b61b96ec1364f08Yin-Chia Yeh     * between [1.0, 3.0] are guaranteed not to be clipped. Even if a given
480d9fc67ce3c1498a911df39675b61b96ec1364f08Yin-Chia Yeh     * device allows gains below 1.0, this is usually not recommended because
481d9fc67ce3c1498a911df39675b61b96ec1364f08Yin-Chia Yeh     * this can create color artifacts.</p>
482fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Units</b>: Unitless gain factors</p>
4834b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4844b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Full capability</b> -
4854b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
4864b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
4870da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     *
4880da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * @see CaptureRequest#COLOR_CORRECTION_MODE
4894b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
4905a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
4916c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
4922bb91a7a68e32530adf730deeef2fe95bad20a96Eino-Ville Talvala    public static final Key<android.hardware.camera2.params.RggbChannelVector> COLOR_CORRECTION_GAINS =
4932bb91a7a68e32530adf730deeef2fe95bad20a96Eino-Ville Talvala            new Key<android.hardware.camera2.params.RggbChannelVector>("android.colorCorrection.gains", android.hardware.camera2.params.RggbChannelVector.class);
4945a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
4955a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
496a05e59d12b410638e97bc2d88c64442c47907fe3Zhijun He     * <p>Mode of operation for the chromatic aberration correction algorithm.</p>
497a05e59d12b410638e97bc2d88c64442c47907fe3Zhijun He     * <p>Chromatic (color) aberration is caused by the fact that different wavelengths of light
498a05e59d12b410638e97bc2d88c64442c47907fe3Zhijun He     * can not focus on the same point after exiting from the lens. This metadata defines
499a05e59d12b410638e97bc2d88c64442c47907fe3Zhijun He     * the high level control of chromatic aberration correction algorithm, which aims to
500a05e59d12b410638e97bc2d88c64442c47907fe3Zhijun He     * minimize the chromatic artifacts that may occur along the object boundaries in an
501a05e59d12b410638e97bc2d88c64442c47907fe3Zhijun He     * image.</p>
502a05e59d12b410638e97bc2d88c64442c47907fe3Zhijun He     * <p>FAST/HIGH_QUALITY both mean that camera device determined aberration
503a05e59d12b410638e97bc2d88c64442c47907fe3Zhijun He     * correction will be applied. HIGH_QUALITY mode indicates that the camera device will
504a05e59d12b410638e97bc2d88c64442c47907fe3Zhijun He     * use the highest-quality aberration correction algorithms, even if it slows down
505a05e59d12b410638e97bc2d88c64442c47907fe3Zhijun He     * capture rate. FAST means the camera device will not slow down capture rate when
506a05e59d12b410638e97bc2d88c64442c47907fe3Zhijun He     * applying aberration correction.</p>
5074b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>LEGACY devices will always be in FAST mode.</p>
508fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
509fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
510fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_OFF OFF}</li>
511fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_FAST FAST}</li>
512fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
513fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
514fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Available values for this device:</b><br>
515fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES android.colorCorrection.availableAberrationModes}</p>
5164b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
517a05e59d12b410638e97bc2d88c64442c47907fe3Zhijun He     *
5189e4e439a688f1859cd895f2ff7ecad75cddb116bZhijun He     * @see CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES
5199e4e439a688f1859cd895f2ff7ecad75cddb116bZhijun He     * @see #COLOR_CORRECTION_ABERRATION_MODE_OFF
5209e4e439a688f1859cd895f2ff7ecad75cddb116bZhijun He     * @see #COLOR_CORRECTION_ABERRATION_MODE_FAST
5219e4e439a688f1859cd895f2ff7ecad75cddb116bZhijun He     * @see #COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY
522a05e59d12b410638e97bc2d88c64442c47907fe3Zhijun He     */
5236c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
5249e4e439a688f1859cd895f2ff7ecad75cddb116bZhijun He    public static final Key<Integer> COLOR_CORRECTION_ABERRATION_MODE =
5259e4e439a688f1859cd895f2ff7ecad75cddb116bZhijun He            new Key<Integer>("android.colorCorrection.aberrationMode", int.class);
526a05e59d12b410638e97bc2d88c64442c47907fe3Zhijun He
527a05e59d12b410638e97bc2d88c64442c47907fe3Zhijun He    /**
528379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <p>The desired setting for the camera device's auto-exposure
529379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * algorithm's antibanding compensation.</p>
530379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <p>Some kinds of lighting fixtures, such as some fluorescent
531379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * lights, flicker at the rate of the power supply frequency
532379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * (60Hz or 50Hz, depending on country). While this is
533379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * typically not noticeable to a person, it can be visible to
534379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * a camera device. If a camera sets its exposure time to the
535379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * wrong value, the flicker may become visible in the
536379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * viewfinder as flicker or in a final captured image, as a
537379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * set of variable-brightness bands across the image.</p>
538379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <p>Therefore, the auto-exposure routines of camera devices
539379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * include antibanding routines that ensure that the chosen
540379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * exposure value will not cause such banding. The choice of
541379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * exposure time depends on the rate of flicker, which the
542379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * camera device can detect automatically, or the expected
543379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * rate can be selected by the application using this
544379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * control.</p>
545379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <p>A given camera device may not support all of the possible
546379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * options for the antibanding mode. The
547379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes} key contains
548379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * the available modes for a given camera device.</p>
5497b2cae6ceca680f6034a9fe43df2446cbae2f090Yin-Chia Yeh     * <p>AUTO mode is the default if it is available on given
5507b2cae6ceca680f6034a9fe43df2446cbae2f090Yin-Chia Yeh     * camera device. When AUTO mode is not available, the
5517b2cae6ceca680f6034a9fe43df2446cbae2f090Yin-Chia Yeh     * default will be either 50HZ or 60HZ, and both 50HZ
5527b2cae6ceca680f6034a9fe43df2446cbae2f090Yin-Chia Yeh     * and 60HZ will be available.</p>
553379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <p>If manual exposure control is enabled (by setting
554379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} to OFF),
555379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * then this setting has no effect, and the application must
556379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * ensure it selects exposure times that do not cause banding
557379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * issues. The {@link CaptureResult#STATISTICS_SCENE_FLICKER android.statistics.sceneFlicker} key can assist
558379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * the application in this.</p>
559fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
560fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
561fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AE_ANTIBANDING_MODE_OFF OFF}</li>
562fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AE_ANTIBANDING_MODE_50HZ 50HZ}</li>
563fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AE_ANTIBANDING_MODE_60HZ 60HZ}</li>
564fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AE_ANTIBANDING_MODE_AUTO AUTO}</li>
565fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
566fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Available values for this device:</b><br></p>
567fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>{@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes}</p>
5684b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
569379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     *
570379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES
571379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see CaptureRequest#CONTROL_AE_MODE
572379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see CaptureRequest#CONTROL_MODE
573379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see CaptureResult#STATISTICS_SCENE_FLICKER
574379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_AE_ANTIBANDING_MODE_OFF
575379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_AE_ANTIBANDING_MODE_50HZ
576379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_AE_ANTIBANDING_MODE_60HZ
577379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_AE_ANTIBANDING_MODE_AUTO
578379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     */
5796c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
580379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He    public static final Key<Integer> CONTROL_AE_ANTIBANDING_MODE =
581379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He            new Key<Integer>("android.control.aeAntibandingMode", int.class);
582379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He
583379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He    /**
584b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <p>Adjustment to auto-exposure (AE) target image
585b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * brightness.</p>
586b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <p>The adjustment is measured as a count of steps, with the
587b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * step size defined by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep} and the
588b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * allowed range by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}.</p>
589b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <p>For example, if the exposure value (EV) step is 0.333, '6'
590b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * will mean an exposure compensation of +2 EV; -3 will mean an
591b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * exposure compensation of -1 EV. One EV represents a doubling
592b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * of image brightness. Note that this control will only be
593b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF. This control
594b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * will take effect even when {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} <code>== true</code>.</p>
595a4227dfe48dcfb49709e05f7db413e0d883997f0Yin-Chia Yeh     * <p>In the event of exposure compensation value being changed, camera device
596a4227dfe48dcfb49709e05f7db413e0d883997f0Yin-Chia Yeh     * may take several frames to reach the newly requested exposure target.
597a4227dfe48dcfb49709e05f7db413e0d883997f0Yin-Chia Yeh     * During that time, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} field will be in the SEARCHING
598a4227dfe48dcfb49709e05f7db413e0d883997f0Yin-Chia Yeh     * state. Once the new exposure target is reached, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} will
599a4227dfe48dcfb49709e05f7db413e0d883997f0Yin-Chia Yeh     * change from SEARCHING to either CONVERGED, LOCKED (if AE lock is enabled), or
600a4227dfe48dcfb49709e05f7db413e0d883997f0Yin-Chia Yeh     * FLASH_REQUIRED (if the scene is too dark for still capture).</p>
601fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Units</b>: Compensation steps</p>
602fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
603fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}</p>
6044b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
605a4227dfe48dcfb49709e05f7db413e0d883997f0Yin-Chia Yeh     *
606b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE
607b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP
608a4227dfe48dcfb49709e05f7db413e0d883997f0Yin-Chia Yeh     * @see CaptureRequest#CONTROL_AE_LOCK
609a4227dfe48dcfb49709e05f7db413e0d883997f0Yin-Chia Yeh     * @see CaptureRequest#CONTROL_AE_MODE
610a4227dfe48dcfb49709e05f7db413e0d883997f0Yin-Chia Yeh     * @see CaptureResult#CONTROL_AE_STATE
611379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     */
6126c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
613379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He    public static final Key<Integer> CONTROL_AE_EXPOSURE_COMPENSATION =
614379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He            new Key<Integer>("android.control.aeExposureCompensation", int.class);
615379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He
616379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He    /**
617b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <p>Whether auto-exposure (AE) is currently locked to its latest
618379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * calculated values.</p>
619fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>When set to <code>true</code> (ON), the AE algorithm is locked to its latest parameters,
620fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * and will not change exposure settings until the lock is set to <code>false</code> (OFF).</p>
621fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Note that even when AE is locked, the flash may be fired if
622fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_AUTO_FLASH /
623fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * ON_ALWAYS_FLASH / ON_AUTO_FLASH_REDEYE.</p>
624a4227dfe48dcfb49709e05f7db413e0d883997f0Yin-Chia Yeh     * <p>When {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation} is changed, even if the AE lock
625a4227dfe48dcfb49709e05f7db413e0d883997f0Yin-Chia Yeh     * is ON, the camera device will still adjust its exposure value.</p>
626379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <p>If AE precapture is triggered (see {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger})
627379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * when AE is already locked, the camera device will not change the exposure time
628379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}) and sensitivity ({@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity})
629379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * parameters. The flash may be fired if the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}
630379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * is ON_AUTO_FLASH/ON_AUTO_FLASH_REDEYE and the scene is too dark. If the
631fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_ALWAYS_FLASH, the scene may become overexposed.
632fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * Similarly, AE precapture trigger CANCEL has no effect when AE is already locked.</p>
633fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * <p>When an AE precapture sequence is triggered, AE unlock will not be able to unlock
634fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * the AE if AE is locked by the camera device internally during precapture metering
635fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * sequence In other words, submitting requests with AE unlock has no effect for an
636fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * ongoing precapture metering sequence. Otherwise, the precapture metering sequence
637fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * will never succeed in a sequence of preview requests where AE lock is always set
638fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * to <code>false</code>.</p>
639fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Since the camera device has a pipeline of in-flight requests, the settings that
640fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * get locked do not necessarily correspond to the settings that were present in the
641fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * latest capture result received from the camera device, since additional captures
642fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * and AE updates may have occurred even before the result was sent out. If an
643fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * application is switching between automatic and manual control and wishes to eliminate
644fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * any flicker during the switch, the following procedure is recommended:</p>
645fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ol>
646fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <li>Starting in auto-AE mode:</li>
647fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <li>Lock AE</li>
648fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <li>Wait for the first result to be output that has the AE locked</li>
649fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <li>Copy exposure settings from that result into a request, set the request to manual AE</li>
650fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <li>Submit the capture request, proceed to run manual AE as desired.</li>
651fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ol>
652379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <p>See {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE lock related state transition details.</p>
6534b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
654379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     *
655a4227dfe48dcfb49709e05f7db413e0d883997f0Yin-Chia Yeh     * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
656379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see CaptureRequest#CONTROL_AE_MODE
657379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
658379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see CaptureResult#CONTROL_AE_STATE
659379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see CaptureRequest#SENSOR_EXPOSURE_TIME
660379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see CaptureRequest#SENSOR_SENSITIVITY
661379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     */
6626c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
663379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He    public static final Key<Boolean> CONTROL_AE_LOCK =
664379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He            new Key<Boolean>("android.control.aeLock", boolean.class);
665379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He
666379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He    /**
6670da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * <p>The desired mode for the camera device's
6680da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * auto-exposure routine.</p>
6690da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is
6700da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * AUTO.</p>
6710da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * <p>When set to any of the ON modes, the camera device's
6720da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * auto-exposure routine is enabled, overriding the
6730da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * application's selected exposure time, sensor sensitivity,
6740da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * and frame duration ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
6750da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and
6760da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}). If one of the FLASH modes
6770da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * is selected, the camera device's flash unit controls are
6780da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * also overridden.</p>
6790da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * <p>The FLASH modes are only available if the camera device
6800da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * has a flash unit ({@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} is <code>true</code>).</p>
6810da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * <p>If flash TORCH mode is desired, this field must be set to
6820da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * ON or OFF, and {@link CaptureRequest#FLASH_MODE android.flash.mode} set to TORCH.</p>
6830da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * <p>When set to any of the ON modes, the values chosen by the
6840da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * camera device auto-exposure routine for the overridden
6850da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * fields for a given capture will be available in its
6860da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * CaptureResult.</p>
687fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
688fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
689fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AE_MODE_OFF OFF}</li>
690fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AE_MODE_ON ON}</li>
691fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH ON_AUTO_FLASH}</li>
692fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AE_MODE_ON_ALWAYS_FLASH ON_ALWAYS_FLASH}</li>
693fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE ON_AUTO_FLASH_REDEYE}</li>
694fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
695fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Available values for this device:</b><br>
696fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES android.control.aeAvailableModes}</p>
6974b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
6980da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     *
699fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_MODES
7005f2a47f3dedfc7859457067d8cdcdbfc28ee08acZhijun He     * @see CaptureRequest#CONTROL_MODE
701265b34ce331cbe296f82ca357645312718c8d4c7Eino-Ville Talvala     * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
702265b34ce331cbe296f82ca357645312718c8d4c7Eino-Ville Talvala     * @see CaptureRequest#FLASH_MODE
703aef3b7ed9f2a27aed9aecef030432d1100a60406Igor Murashkin     * @see CaptureRequest#SENSOR_EXPOSURE_TIME
704aef3b7ed9f2a27aed9aecef030432d1100a60406Igor Murashkin     * @see CaptureRequest#SENSOR_FRAME_DURATION
705399f05d1e7182ef6c88d30d3b98a467b845ca7c4Zhijun He     * @see CaptureRequest#SENSOR_SENSITIVITY
7060da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * @see #CONTROL_AE_MODE_OFF
7070da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * @see #CONTROL_AE_MODE_ON
7080da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * @see #CONTROL_AE_MODE_ON_AUTO_FLASH
7090da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * @see #CONTROL_AE_MODE_ON_ALWAYS_FLASH
7100da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * @see #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE
7110da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     */
7126c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
7130da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala    public static final Key<Integer> CONTROL_AE_MODE =
7140da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala            new Key<Integer>("android.control.aeMode", int.class);
7150da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala
7160da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala    /**
717fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>List of metering areas to use for auto-exposure adjustment.</p>
718fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe} is 0.
719808150f066b53da1573e8b1fbd6b377d0fc229f8Yin-Chia Yeh     * Otherwise will always be present.</p>
720fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>The maximum number of regions supported by the device is determined by the value
721fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AE android.control.maxRegionsAe}.</p>
722ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>The coordinate system is based on the active pixel array,
7232629f27362f1a35521501f3a28279ab05b9beb32Timothy Knight     * with (0,0) being the top-left pixel in the active pixel array, and
7240da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
7250da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
72697f1c854993a65b2c700426a1e3a83b23ea65337Yin-Chia Yeh     * bottom-right pixel in the active pixel array.</p>
727fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight
72897f1c854993a65b2c700426a1e3a83b23ea65337Yin-Chia Yeh     * for every pixel in the area. This means that a large metering area
72997f1c854993a65b2c700426a1e3a83b23ea65337Yin-Chia Yeh     * with the same weight as a smaller area will have more effect in
73097f1c854993a65b2c700426a1e3a83b23ea65337Yin-Chia Yeh     * the metering result. Metering areas can partially overlap and the
73197f1c854993a65b2c700426a1e3a83b23ea65337Yin-Chia Yeh     * camera device will add the weights in the overlap region.</p>
732fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>The weights are relative to weights of other exposure metering regions, so if only one
733fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * region is used, all non-zero weights will have the same effect. A region with 0
734fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * weight is ignored.</p>
735fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
736fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * camera device.</p>
737fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
738fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * capture result metadata, the camera device will ignore the sections outside the crop
739fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * region and output only the intersection rectangle as the metering region in the result
740fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * metadata.  If the region is entirely outside the crop region, it will be ignored and
741fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * not reported in the result metadata.</p>
742fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
743fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
744fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * Coordinates must be between <code>[(0,0), (width, height))</code> of
745fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
746808150f066b53da1573e8b1fbd6b377d0fc229f8Yin-Chia Yeh     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
7470da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     *
748808150f066b53da1573e8b1fbd6b377d0fc229f8Yin-Chia Yeh     * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AE
7490da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * @see CaptureRequest#SCALER_CROP_REGION
750265b34ce331cbe296f82ca357645312718c8d4c7Eino-Ville Talvala     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
7515a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
7526c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
753817f8933ee1c11130ad2ca45b5ac8ce8b729f125Yin-Chia Yeh    public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AE_REGIONS =
754817f8933ee1c11130ad2ca45b5ac8ce8b729f125Yin-Chia Yeh            new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.aeRegions", android.hardware.camera2.params.MeteringRectangle[].class);
7555a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
7565a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
757fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Range over which the auto-exposure routine can
758fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * adjust the capture frame rate to maintain good
759fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * exposure.</p>
760b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <p>Only constrains auto-exposure (AE) algorithm, not
761fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * manual control of {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime} and
762fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}.</p>
763fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Units</b>: Frames per second (FPS)</p>
764fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
765fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * Any of the entries in {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES android.control.aeAvailableTargetFpsRanges}</p>
766fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>This key is available on all devices.</p>
767379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     *
768fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES
769379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see CaptureRequest#SENSOR_EXPOSURE_TIME
770fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * @see CaptureRequest#SENSOR_FRAME_DURATION
771379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     */
7726c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
77378712a8bd7275542013ba099f33536eead0167fbIgor Murashkin    public static final Key<android.util.Range<Integer>> CONTROL_AE_TARGET_FPS_RANGE =
77478712a8bd7275542013ba099f33536eead0167fbIgor Murashkin            new Key<android.util.Range<Integer>>("android.control.aeTargetFpsRange", new TypeReference<android.util.Range<Integer>>() {{ }});
775379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He
776379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He    /**
777379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <p>Whether the camera device will trigger a precapture
778379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * metering sequence when it processes this request.</p>
779379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <p>This entry is normally set to IDLE, or is not
780379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * included at all in the request settings. When included and
781dd72be5971039f6f61af47c956287dc28b33f34cZhijun He     * set to START, the camera device will trigger the auto-exposure (AE)
782379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * precapture metering sequence.</p>
783fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * <p>When set to CANCEL, the camera device will cancel any active
784fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * precapture metering trigger, and return to its initial AE state.
785fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * If a precapture metering sequence is already completed, and the camera
786fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * device has implicitly locked the AE for subsequent still capture, the
787fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * CANCEL trigger will unlock the AE and return to its initial AE state.</p>
788dd72be5971039f6f61af47c956287dc28b33f34cZhijun He     * <p>The precapture sequence should be triggered before starting a
789e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * high-quality still capture for final metering decisions to
790e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * be made, and for firing pre-capture flash pulses to estimate
791e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * scene brightness and required final capture flash power, when
792e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * the flash is enabled.</p>
793e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * <p>Normally, this entry should be set to START for only a
794e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * single request, and the application should wait until the
795e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * sequence completes before starting a new one.</p>
796dd72be5971039f6f61af47c956287dc28b33f34cZhijun He     * <p>When a precapture metering sequence is finished, the camera device
797dd72be5971039f6f61af47c956287dc28b33f34cZhijun He     * may lock the auto-exposure routine internally to be able to accurately expose the
798dd72be5971039f6f61af47c956287dc28b33f34cZhijun He     * subsequent still capture image (<code>{@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} == STILL_CAPTURE</code>).
799dd72be5971039f6f61af47c956287dc28b33f34cZhijun He     * For this case, the AE may not resume normal scan if no subsequent still capture is
800dd72be5971039f6f61af47c956287dc28b33f34cZhijun He     * submitted. To ensure that the AE routine restarts normal scan, the application should
801dd72be5971039f6f61af47c956287dc28b33f34cZhijun He     * submit a request with <code>{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} == true</code>, followed by a request
802dd72be5971039f6f61af47c956287dc28b33f34cZhijun He     * with <code>{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} == false</code>, if the application decides not to submit a
803fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * still capture request after the precapture sequence completes. Alternatively, for
804fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * API level 23 or newer devices, the CANCEL can be used to unlock the camera device
805fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * internally locked AE if the application doesn't submit a still capture request after
806fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * the AE precapture trigger. Note that, the CANCEL was added in API level 23, and must not
807fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * be used in devices that have earlier API levels.</p>
808e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * <p>The exact effect of auto-exposure (AE) precapture trigger
809e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * depends on the current AE mode and state; see
810b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE precapture state transition
811b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * details.</p>
812fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>On LEGACY-level devices, the precapture trigger is not supported;
813fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * capturing a high-resolution JPEG image will automatically trigger a
814fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * precapture sequence before the high-resolution capture, including
815fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * potentially firing a pre-capture flash.</p>
816f8a2f575900c527ce3fc73076fa88453a51017d0Eino-Ville Talvala     * <p>Using the precapture trigger and the auto-focus trigger {@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger}
817f8a2f575900c527ce3fc73076fa88453a51017d0Eino-Ville Talvala     * simultaneously is allowed. However, since these triggers often require cooperation between
818f8a2f575900c527ce3fc73076fa88453a51017d0Eino-Ville Talvala     * the auto-focus and auto-exposure routines (for example, the may need to be enabled for a
819f8a2f575900c527ce3fc73076fa88453a51017d0Eino-Ville Talvala     * focus sweep), the camera device may delay acting on a later trigger until the previous
820f8a2f575900c527ce3fc73076fa88453a51017d0Eino-Ville Talvala     * trigger has been fully handled. This may lead to longer intervals between the trigger and
821f8a2f575900c527ce3fc73076fa88453a51017d0Eino-Ville Talvala     * changes to {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} indicating the start of the precapture sequence, for
822f8a2f575900c527ce3fc73076fa88453a51017d0Eino-Ville Talvala     * example.</p>
823f8a2f575900c527ce3fc73076fa88453a51017d0Eino-Ville Talvala     * <p>If both the precapture and the auto-focus trigger are activated on the same request, then
824f8a2f575900c527ce3fc73076fa88453a51017d0Eino-Ville Talvala     * the camera device will complete them in the optimal order for that device.</p>
825fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
826fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
827fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE IDLE}</li>
828fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_START START}</li>
829fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     *   <li>{@link #CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL CANCEL}</li>
830fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
8314b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
8324b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Limited capability</b> -
8334b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
8344b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
835379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     *
836dd72be5971039f6f61af47c956287dc28b33f34cZhijun He     * @see CaptureRequest#CONTROL_AE_LOCK
837379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see CaptureResult#CONTROL_AE_STATE
838f8a2f575900c527ce3fc73076fa88453a51017d0Eino-Ville Talvala     * @see CaptureRequest#CONTROL_AF_TRIGGER
839dd72be5971039f6f61af47c956287dc28b33f34cZhijun He     * @see CaptureRequest#CONTROL_CAPTURE_INTENT
8404b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
841379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE
842379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_AE_PRECAPTURE_TRIGGER_START
843fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * @see #CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL
844379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     */
8456c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
846379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He    public static final Key<Integer> CONTROL_AE_PRECAPTURE_TRIGGER =
847379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He            new Key<Integer>("android.control.aePrecaptureTrigger", int.class);
848379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He
849379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He    /**
850e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * <p>Current state of the auto-exposure (AE) algorithm.</p>
851228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <p>Switching between or enabling AE modes ({@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}) always
852228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * resets the AE state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
853228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
854228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * the algorithm states to INACTIVE.</p>
855228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <p>The camera device can do several state transitions between two results, if it is
856228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * allowed by the state transition table. For example: INACTIVE may never actually be
857228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * seen in a result.</p>
858228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <p>The state in the result is the state for this image (in sync with this image): if
859228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * AE state becomes CONVERGED, then the image data associated with this result should
860228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * be good to use.</p>
861228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <p>Below are state transition tables for different AE modes.</p>
862228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <table>
863228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <thead>
864228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
865228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <th align="center">State</th>
866228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <th align="center">Transition Cause</th>
867228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <th align="center">New State</th>
868228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <th align="center">Notes</th>
869228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
870228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </thead>
871228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tbody>
872228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
873228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">INACTIVE</td>
874228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center"></td>
875228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">INACTIVE</td>
876228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Camera device auto exposure algorithm is disabled</td>
877228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
878228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tbody>
879228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </table>
880228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <p>When {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is AE_MODE_ON_*:</p>
881228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <table>
882228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <thead>
883228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
884228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <th align="center">State</th>
885228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <th align="center">Transition Cause</th>
886228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <th align="center">New State</th>
887228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <th align="center">Notes</th>
888228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
889228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </thead>
890228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tbody>
891228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
892228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">INACTIVE</td>
893228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Camera device initiates AE scan</td>
894228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">SEARCHING</td>
895228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Values changing</td>
896228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
897228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
898228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">INACTIVE</td>
899228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
900228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">LOCKED</td>
901228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Values locked</td>
902228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
903228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
904228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">SEARCHING</td>
905228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Camera device finishes AE scan</td>
906228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">CONVERGED</td>
907228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Good values, not changing</td>
908228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
909228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
910228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">SEARCHING</td>
911228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Camera device finishes AE scan</td>
912228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">FLASH_REQUIRED</td>
913228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Converged but too dark w/o flash</td>
914228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
915228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
916228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">SEARCHING</td>
917228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
918228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">LOCKED</td>
919228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Values locked</td>
920228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
921228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
922228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">CONVERGED</td>
923228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Camera device initiates AE scan</td>
924228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">SEARCHING</td>
925228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Values changing</td>
926228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
927228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
928228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">CONVERGED</td>
929228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
930228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">LOCKED</td>
931228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Values locked</td>
932228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
933228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
934228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">FLASH_REQUIRED</td>
935228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Camera device initiates AE scan</td>
936228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">SEARCHING</td>
937228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Values changing</td>
938228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
939228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
940228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">FLASH_REQUIRED</td>
941228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
942228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">LOCKED</td>
943228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Values locked</td>
944228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
945228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
946228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">LOCKED</td>
947228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
948228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">SEARCHING</td>
949228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Values not good after unlock</td>
950228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
951228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
952228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">LOCKED</td>
953228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
954228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">CONVERGED</td>
955228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Values good after unlock</td>
956228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
957228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
958228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">LOCKED</td>
959228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
960228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">FLASH_REQUIRED</td>
961228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Exposure good, but too dark</td>
962228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
963228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
964228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">PRECAPTURE</td>
965228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is OFF</td>
966228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">CONVERGED</td>
967228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Ready for high-quality capture</td>
968228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
969228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
970228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">PRECAPTURE</td>
971228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Sequence done. {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} is ON</td>
972228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">LOCKED</td>
973228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Ready for high-quality capture</td>
974228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
975228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
976fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * <td align="center">LOCKED</td>
977fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * <td align="center">aeLock is ON and aePrecaptureTrigger is START</td>
978fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * <td align="center">LOCKED</td>
979fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * <td align="center">Precapture trigger is ignored when AE is already locked</td>
980fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * </tr>
981fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * <tr>
982fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * <td align="center">LOCKED</td>
983fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * <td align="center">aeLock is ON and aePrecaptureTrigger is CANCEL</td>
984fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * <td align="center">LOCKED</td>
985fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * <td align="center">Precapture trigger is ignored when AE is already locked</td>
986fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * </tr>
987fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * <tr>
988fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * <td align="center">Any state (excluding LOCKED)</td>
989228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START</td>
990228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">PRECAPTURE</td>
991228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Start AE precapture metering sequence</td>
992228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
993fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * <tr>
994fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * <td align="center">Any state (excluding LOCKED)</td>
995fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is CANCEL</td>
996fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * <td align="center">INACTIVE</td>
997fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * <td align="center">Currently active precapture metering sequence is canceled</td>
998fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * </tr>
999228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tbody>
1000228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </table>
100160b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <p>For the above table, the camera device may skip reporting any state changes that happen
100260b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * without application intervention (i.e. mode switch, trigger, locking). Any state that
100360b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * can be skipped in that manner is called a transient state.</p>
100460b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <p>For example, for above AE modes (AE_MODE_ON_*), in addition to the state transitions
100560b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * listed in above table, it is also legal for the camera device to skip one or more
100660b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * transient states between two results. See below table for examples:</p>
100760b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <table>
100860b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <thead>
100960b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <tr>
101060b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <th align="center">State</th>
101160b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <th align="center">Transition Cause</th>
101260b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <th align="center">New State</th>
101360b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <th align="center">Notes</th>
101460b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * </tr>
101560b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * </thead>
101660b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <tbody>
101760b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <tr>
101860b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">INACTIVE</td>
101960b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">Camera device finished AE scan</td>
102060b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">CONVERGED</td>
102160b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">Values are already good, transient states are skipped by camera device.</td>
102260b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * </tr>
102360b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <tr>
1024fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * <td align="center">Any state (excluding LOCKED)</td>
102560b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td>
102660b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">FLASH_REQUIRED</td>
102760b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">Converged but too dark w/o flash after a precapture sequence, transient states are skipped by camera device.</td>
102860b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * </tr>
102960b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <tr>
1030fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * <td align="center">Any state (excluding LOCKED)</td>
103160b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is START, sequence done</td>
103260b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">CONVERGED</td>
103360b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">Converged after a precapture sequence, transient states are skipped by camera device.</td>
103460b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * </tr>
103560b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <tr>
1036fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * <td align="center">Any state (excluding LOCKED)</td>
1037fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is CANCEL, converged</td>
1038fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * <td align="center">FLASH_REQUIRED</td>
1039fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * <td align="center">Converged but too dark w/o flash after a precapture sequence is canceled, transient states are skipped by camera device.</td>
1040fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * </tr>
1041fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * <tr>
1042fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * <td align="center">Any state (excluding LOCKED)</td>
1043fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * <td align="center">{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is CANCEL, converged</td>
1044fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * <td align="center">CONVERGED</td>
1045fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * <td align="center">Converged after a precapture sequenceis canceled, transient states are skipped by camera device.</td>
1046fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * </tr>
1047fa95b0420ce819e5f559cd97f9edb086e9eebb71Zhijun He     * <tr>
104860b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">CONVERGED</td>
104960b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">Camera device finished AE scan</td>
105060b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">FLASH_REQUIRED</td>
105160b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">Converged but too dark w/o flash after a new scan, transient states are skipped by camera device.</td>
105260b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * </tr>
105360b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <tr>
105460b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">FLASH_REQUIRED</td>
105560b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">Camera device finished AE scan</td>
105660b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">CONVERGED</td>
105760b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">Converged after a new scan, transient states are skipped by camera device.</td>
105860b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * </tr>
105960b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * </tbody>
106060b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * </table>
1061fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
1062fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
1063fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AE_STATE_INACTIVE INACTIVE}</li>
1064fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AE_STATE_SEARCHING SEARCHING}</li>
1065fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AE_STATE_CONVERGED CONVERGED}</li>
1066fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AE_STATE_LOCKED LOCKED}</li>
1067fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AE_STATE_FLASH_REQUIRED FLASH_REQUIRED}</li>
1068fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AE_STATE_PRECAPTURE PRECAPTURE}</li>
1069fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
10704b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
10714b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Limited capability</b> -
10724b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
10734b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1074228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     *
1075228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * @see CaptureRequest#CONTROL_AE_LOCK
1076228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * @see CaptureRequest#CONTROL_AE_MODE
1077228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
1078228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * @see CaptureRequest#CONTROL_MODE
1079228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * @see CaptureRequest#CONTROL_SCENE_MODE
10804b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
10815a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AE_STATE_INACTIVE
10825a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AE_STATE_SEARCHING
10835a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AE_STATE_CONVERGED
10845a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AE_STATE_LOCKED
10855a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AE_STATE_FLASH_REQUIRED
10865a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AE_STATE_PRECAPTURE
10875a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
10886c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
10895a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Integer> CONTROL_AE_STATE =
10905a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Integer>("android.control.aeState", int.class);
10915a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
10925a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
1093b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <p>Whether auto-focus (AF) is currently enabled, and what
1094b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * mode it is set to.</p>
1095cc28a41b48bc687002a9e1fc436d00ca6f0c3692Zhijun He     * <p>Only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} = AUTO and the lens is not fixed focus
10967144b5d2cf445ed245cfd9b09c7897966d01b5ffYin-Chia Yeh     * (i.e. <code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} &gt; 0</code>). Also note that
10977144b5d2cf445ed245cfd9b09c7897966d01b5ffYin-Chia Yeh     * when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF, the behavior of AF is device
10987144b5d2cf445ed245cfd9b09c7897966d01b5ffYin-Chia Yeh     * dependent. It is recommended to lock AF by using {@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger} before
10997144b5d2cf445ed245cfd9b09c7897966d01b5ffYin-Chia Yeh     * setting {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} to OFF, or set AF mode to OFF when AE is OFF.</p>
110078146ecb24871302a4c4dc0a7341044a06d29ee8Zhijun He     * <p>If the lens is controlled by the camera device auto-focus algorithm,
1101d8fd67931e17c66e530de5482b63863e6c4301aaEino-Ville Talvala     * the camera device will report the current AF status in {@link CaptureResult#CONTROL_AF_STATE android.control.afState}
1102fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * in result metadata.</p>
1103fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
1104fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
1105fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AF_MODE_OFF OFF}</li>
1106fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AF_MODE_AUTO AUTO}</li>
1107fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AF_MODE_MACRO MACRO}</li>
1108fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AF_MODE_CONTINUOUS_VIDEO CONTINUOUS_VIDEO}</li>
1109fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AF_MODE_CONTINUOUS_PICTURE CONTINUOUS_PICTURE}</li>
1110fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AF_MODE_EDOF EDOF}</li>
1111fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
1112fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Available values for this device:</b><br>
1113fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES android.control.afAvailableModes}</p>
1114fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>This key is available on all devices.</p>
11150da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     *
11167144b5d2cf445ed245cfd9b09c7897966d01b5ffYin-Chia Yeh     * @see CaptureRequest#CONTROL_AE_MODE
1117fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * @see CameraCharacteristics#CONTROL_AF_AVAILABLE_MODES
1118d8fd67931e17c66e530de5482b63863e6c4301aaEino-Ville Talvala     * @see CaptureResult#CONTROL_AF_STATE
11197144b5d2cf445ed245cfd9b09c7897966d01b5ffYin-Chia Yeh     * @see CaptureRequest#CONTROL_AF_TRIGGER
11200da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * @see CaptureRequest#CONTROL_MODE
1121cc28a41b48bc687002a9e1fc436d00ca6f0c3692Zhijun He     * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
11225a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AF_MODE_OFF
11235a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AF_MODE_AUTO
11245a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AF_MODE_MACRO
11255a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO
11265a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE
11275a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AF_MODE_EDOF
11285a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
11296c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
11305a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Integer> CONTROL_AF_MODE =
11315a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Integer>("android.control.afMode", int.class);
11325a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
11335a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
1134fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>List of metering areas to use for auto-focus.</p>
1135fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf} is 0.
1136808150f066b53da1573e8b1fbd6b377d0fc229f8Yin-Chia Yeh     * Otherwise will always be present.</p>
1137fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>The maximum number of focus areas supported by the device is determined by the value
1138fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AF android.control.maxRegionsAf}.</p>
1139ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>The coordinate system is based on the active pixel array,
11402629f27362f1a35521501f3a28279ab05b9beb32Timothy Knight     * with (0,0) being the top-left pixel in the active pixel array, and
11410da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
11420da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
114397f1c854993a65b2c700426a1e3a83b23ea65337Yin-Chia Yeh     * bottom-right pixel in the active pixel array.</p>
1144fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>The weight must be within <code>[0, 1000]</code>, and represents a weight
114597f1c854993a65b2c700426a1e3a83b23ea65337Yin-Chia Yeh     * for every pixel in the area. This means that a large metering area
114697f1c854993a65b2c700426a1e3a83b23ea65337Yin-Chia Yeh     * with the same weight as a smaller area will have more effect in
114797f1c854993a65b2c700426a1e3a83b23ea65337Yin-Chia Yeh     * the metering result. Metering areas can partially overlap and the
114897f1c854993a65b2c700426a1e3a83b23ea65337Yin-Chia Yeh     * camera device will add the weights in the overlap region.</p>
1149fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>The weights are relative to weights of other metering regions, so if only one region
1150fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * is used, all non-zero weights will have the same effect. A region with 0 weight is
1151fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * ignored.</p>
1152fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
1153fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * camera device.</p>
1154fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
1155fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * capture result metadata, the camera device will ignore the sections outside the crop
1156fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * region and output only the intersection rectangle as the metering region in the result
1157fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * metadata. If the region is entirely outside the crop region, it will be ignored and
1158fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * not reported in the result metadata.</p>
1159fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
1160fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
1161fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * Coordinates must be between <code>[(0,0), (width, height))</code> of
1162fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
1163808150f066b53da1573e8b1fbd6b377d0fc229f8Yin-Chia Yeh     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
11640da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     *
1165808150f066b53da1573e8b1fbd6b377d0fc229f8Yin-Chia Yeh     * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AF
11660da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * @see CaptureRequest#SCALER_CROP_REGION
1167265b34ce331cbe296f82ca357645312718c8d4c7Eino-Ville Talvala     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
11685a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
11696c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
1170817f8933ee1c11130ad2ca45b5ac8ce8b729f125Yin-Chia Yeh    public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AF_REGIONS =
1171817f8933ee1c11130ad2ca45b5ac8ce8b729f125Yin-Chia Yeh            new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.afRegions", android.hardware.camera2.params.MeteringRectangle[].class);
11725a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
11735a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
1174379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <p>Whether the camera device will trigger autofocus for this request.</p>
1175379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <p>This entry is normally set to IDLE, or is not
1176379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * included at all in the request settings.</p>
1177379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <p>When included and set to START, the camera device will trigger the
1178379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * autofocus algorithm. If autofocus is disabled, this trigger has no effect.</p>
1179379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <p>When set to CANCEL, the camera device will cancel any active trigger,
1180379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * and return to its initial AF state.</p>
1181e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * <p>Generally, applications should set this entry to START or CANCEL for only a
1182e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * single capture, and then return it to IDLE (or not set at all). Specifying
1183e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * START for multiple captures in a row means restarting the AF operation over
1184e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * and over again.</p>
1185e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * <p>See {@link CaptureResult#CONTROL_AF_STATE android.control.afState} for what the trigger means for each AF mode.</p>
1186f8a2f575900c527ce3fc73076fa88453a51017d0Eino-Ville Talvala     * <p>Using the autofocus trigger and the precapture trigger {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}
1187f8a2f575900c527ce3fc73076fa88453a51017d0Eino-Ville Talvala     * simultaneously is allowed. However, since these triggers often require cooperation between
1188f8a2f575900c527ce3fc73076fa88453a51017d0Eino-Ville Talvala     * the auto-focus and auto-exposure routines (for example, the may need to be enabled for a
1189f8a2f575900c527ce3fc73076fa88453a51017d0Eino-Ville Talvala     * focus sweep), the camera device may delay acting on a later trigger until the previous
1190f8a2f575900c527ce3fc73076fa88453a51017d0Eino-Ville Talvala     * trigger has been fully handled. This may lead to longer intervals between the trigger and
1191f8a2f575900c527ce3fc73076fa88453a51017d0Eino-Ville Talvala     * changes to {@link CaptureResult#CONTROL_AF_STATE android.control.afState}, for example.</p>
1192fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
1193fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
1194fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AF_TRIGGER_IDLE IDLE}</li>
1195fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AF_TRIGGER_START START}</li>
1196fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AF_TRIGGER_CANCEL CANCEL}</li>
1197fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
11984b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
1199379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     *
1200f8a2f575900c527ce3fc73076fa88453a51017d0Eino-Ville Talvala     * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
1201379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see CaptureResult#CONTROL_AF_STATE
1202379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_AF_TRIGGER_IDLE
1203379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_AF_TRIGGER_START
1204379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_AF_TRIGGER_CANCEL
1205379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     */
12066c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
1207379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He    public static final Key<Integer> CONTROL_AF_TRIGGER =
1208379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He            new Key<Integer>("android.control.afTrigger", int.class);
1209379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He
1210379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He    /**
1211b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <p>Current state of auto-focus (AF) algorithm.</p>
1212228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <p>Switching between or enabling AF modes ({@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}) always
1213228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * resets the AF state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
1214228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
1215228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * the algorithm states to INACTIVE.</p>
1216228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <p>The camera device can do several state transitions between two results, if it is
1217228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * allowed by the state transition table. For example: INACTIVE may never actually be
1218228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * seen in a result.</p>
1219228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <p>The state in the result is the state for this image (in sync with this image): if
1220228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * AF state becomes FOCUSED, then the image data associated with this result should
1221228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * be sharp.</p>
1222228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <p>Below are state transition tables for different AF modes.</p>
1223228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_OFF or AF_MODE_EDOF:</p>
1224228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <table>
1225228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <thead>
1226228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1227228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <th align="center">State</th>
1228228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <th align="center">Transition Cause</th>
1229228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <th align="center">New State</th>
1230228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <th align="center">Notes</th>
1231228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1232228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </thead>
1233228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tbody>
1234228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1235228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">INACTIVE</td>
1236228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center"></td>
1237228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">INACTIVE</td>
1238228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Never changes</td>
1239228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1240228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tbody>
1241228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </table>
1242228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_AUTO or AF_MODE_MACRO:</p>
1243228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <table>
1244228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <thead>
1245228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1246228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <th align="center">State</th>
1247228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <th align="center">Transition Cause</th>
1248228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <th align="center">New State</th>
1249228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <th align="center">Notes</th>
1250228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1251228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </thead>
1252228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tbody>
1253228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1254228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">INACTIVE</td>
1255228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">AF_TRIGGER</td>
1256228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">ACTIVE_SCAN</td>
1257228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Start AF sweep, Lens now moving</td>
1258228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1259228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1260228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">ACTIVE_SCAN</td>
1261228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">AF sweep done</td>
1262228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">FOCUSED_LOCKED</td>
1263228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Focused, Lens now locked</td>
1264228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1265228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1266228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">ACTIVE_SCAN</td>
1267228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">AF sweep done</td>
1268228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">NOT_FOCUSED_LOCKED</td>
1269228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Not focused, Lens now locked</td>
1270228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1271228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1272228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">ACTIVE_SCAN</td>
1273228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">AF_CANCEL</td>
1274228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">INACTIVE</td>
1275228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Cancel/reset AF, Lens now locked</td>
1276228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1277228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1278228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">FOCUSED_LOCKED</td>
1279228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">AF_CANCEL</td>
1280228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">INACTIVE</td>
1281228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Cancel/reset AF</td>
1282228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1283228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1284228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">FOCUSED_LOCKED</td>
1285228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">AF_TRIGGER</td>
1286228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">ACTIVE_SCAN</td>
1287228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Start new sweep, Lens now moving</td>
1288228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1289228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1290228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">NOT_FOCUSED_LOCKED</td>
1291228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">AF_CANCEL</td>
1292228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">INACTIVE</td>
1293228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Cancel/reset AF</td>
1294228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1295228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1296228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">NOT_FOCUSED_LOCKED</td>
1297228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">AF_TRIGGER</td>
1298228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">ACTIVE_SCAN</td>
1299228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Start new sweep, Lens now moving</td>
1300228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1301228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1302228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Any state</td>
1303228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Mode change</td>
1304228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">INACTIVE</td>
1305228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center"></td>
1306228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1307228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tbody>
1308228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </table>
130960b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <p>For the above table, the camera device may skip reporting any state changes that happen
131060b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * without application intervention (i.e. mode switch, trigger, locking). Any state that
131160b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * can be skipped in that manner is called a transient state.</p>
131260b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <p>For example, for these AF modes (AF_MODE_AUTO and AF_MODE_MACRO), in addition to the
131360b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * state transitions listed in above table, it is also legal for the camera device to skip
131460b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * one or more transient states between two results. See below table for examples:</p>
131560b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <table>
131660b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <thead>
131760b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <tr>
131860b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <th align="center">State</th>
131960b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <th align="center">Transition Cause</th>
132060b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <th align="center">New State</th>
132160b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <th align="center">Notes</th>
132260b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * </tr>
132360b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * </thead>
132460b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <tbody>
132560b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <tr>
132660b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">INACTIVE</td>
132760b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">AF_TRIGGER</td>
132860b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">FOCUSED_LOCKED</td>
132960b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">Focus is already good or good after a scan, lens is now locked.</td>
133060b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * </tr>
133160b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <tr>
133260b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">INACTIVE</td>
133360b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">AF_TRIGGER</td>
133460b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">NOT_FOCUSED_LOCKED</td>
133560b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">Focus failed after a scan, lens is now locked.</td>
133660b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * </tr>
133760b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <tr>
133860b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">FOCUSED_LOCKED</td>
133960b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">AF_TRIGGER</td>
134060b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">FOCUSED_LOCKED</td>
134160b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">Focus is already good or good after a scan, lens is now locked.</td>
134260b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * </tr>
134360b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <tr>
134460b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">NOT_FOCUSED_LOCKED</td>
134560b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">AF_TRIGGER</td>
134660b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">FOCUSED_LOCKED</td>
134760b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">Focus is good after a scan, lens is not locked.</td>
134860b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * </tr>
134960b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * </tbody>
135060b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * </table>
1351228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_VIDEO:</p>
1352228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <table>
1353228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <thead>
1354228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1355228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <th align="center">State</th>
1356228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <th align="center">Transition Cause</th>
1357228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <th align="center">New State</th>
1358228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <th align="center">Notes</th>
1359228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1360228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </thead>
1361228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tbody>
1362228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1363228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">INACTIVE</td>
1364228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Camera device initiates new scan</td>
1365228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">PASSIVE_SCAN</td>
1366228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Start AF scan, Lens now moving</td>
1367228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1368228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1369228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">INACTIVE</td>
1370228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">AF_TRIGGER</td>
1371228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">NOT_FOCUSED_LOCKED</td>
1372228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">AF state query, Lens now locked</td>
1373228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1374228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1375228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">PASSIVE_SCAN</td>
1376228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Camera device completes current scan</td>
1377228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">PASSIVE_FOCUSED</td>
1378228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">End AF scan, Lens now locked</td>
1379228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1380228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1381228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">PASSIVE_SCAN</td>
1382228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Camera device fails current scan</td>
1383228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">PASSIVE_UNFOCUSED</td>
1384228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">End AF scan, Lens now locked</td>
1385228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1386228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1387228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">PASSIVE_SCAN</td>
1388228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">AF_TRIGGER</td>
1389228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">FOCUSED_LOCKED</td>
1390e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * <td align="center">Immediate transition, if focus is good. Lens now locked</td>
1391228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1392228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1393228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">PASSIVE_SCAN</td>
1394228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">AF_TRIGGER</td>
1395228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">NOT_FOCUSED_LOCKED</td>
1396e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * <td align="center">Immediate transition, if focus is bad. Lens now locked</td>
1397228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1398228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1399228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">PASSIVE_SCAN</td>
1400228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">AF_CANCEL</td>
1401228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">INACTIVE</td>
1402228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Reset lens position, Lens now locked</td>
1403228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1404228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1405228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">PASSIVE_FOCUSED</td>
1406228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Camera device initiates new scan</td>
1407228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">PASSIVE_SCAN</td>
1408228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Start AF scan, Lens now moving</td>
1409228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1410228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1411228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">PASSIVE_UNFOCUSED</td>
1412228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Camera device initiates new scan</td>
1413228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">PASSIVE_SCAN</td>
1414228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Start AF scan, Lens now moving</td>
1415228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1416228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1417228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">PASSIVE_FOCUSED</td>
1418228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">AF_TRIGGER</td>
1419228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">FOCUSED_LOCKED</td>
1420e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * <td align="center">Immediate transition, lens now locked</td>
1421228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1422228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1423228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">PASSIVE_UNFOCUSED</td>
1424228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">AF_TRIGGER</td>
1425228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">NOT_FOCUSED_LOCKED</td>
1426e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * <td align="center">Immediate transition, lens now locked</td>
1427228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1428228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1429228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">FOCUSED_LOCKED</td>
1430228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">AF_TRIGGER</td>
1431228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">FOCUSED_LOCKED</td>
1432228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">No effect</td>
1433228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1434228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1435228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">FOCUSED_LOCKED</td>
1436228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">AF_CANCEL</td>
1437228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">INACTIVE</td>
1438228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Restart AF scan</td>
1439228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1440228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1441228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">NOT_FOCUSED_LOCKED</td>
1442228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">AF_TRIGGER</td>
1443228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">NOT_FOCUSED_LOCKED</td>
1444228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">No effect</td>
1445228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1446228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1447228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">NOT_FOCUSED_LOCKED</td>
1448228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">AF_CANCEL</td>
1449228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">INACTIVE</td>
1450228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Restart AF scan</td>
1451228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1452228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tbody>
1453228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </table>
1454228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <p>When {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} is AF_MODE_CONTINUOUS_PICTURE:</p>
1455228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <table>
1456228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <thead>
1457228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1458228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <th align="center">State</th>
1459228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <th align="center">Transition Cause</th>
1460228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <th align="center">New State</th>
1461228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <th align="center">Notes</th>
1462228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1463228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </thead>
1464228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tbody>
1465228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1466228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">INACTIVE</td>
1467228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Camera device initiates new scan</td>
1468228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">PASSIVE_SCAN</td>
1469228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Start AF scan, Lens now moving</td>
1470228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1471228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1472228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">INACTIVE</td>
1473228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">AF_TRIGGER</td>
1474228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">NOT_FOCUSED_LOCKED</td>
1475228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">AF state query, Lens now locked</td>
1476228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1477228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1478228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">PASSIVE_SCAN</td>
1479228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Camera device completes current scan</td>
1480228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">PASSIVE_FOCUSED</td>
1481228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">End AF scan, Lens now locked</td>
1482228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1483228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1484228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">PASSIVE_SCAN</td>
1485228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Camera device fails current scan</td>
1486228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">PASSIVE_UNFOCUSED</td>
1487228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">End AF scan, Lens now locked</td>
1488228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1489228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1490228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">PASSIVE_SCAN</td>
1491228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">AF_TRIGGER</td>
1492228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">FOCUSED_LOCKED</td>
1493e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * <td align="center">Eventual transition once the focus is good. Lens now locked</td>
1494228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1495228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1496228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">PASSIVE_SCAN</td>
1497228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">AF_TRIGGER</td>
1498228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">NOT_FOCUSED_LOCKED</td>
1499e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * <td align="center">Eventual transition if cannot find focus. Lens now locked</td>
1500228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1501228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1502228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">PASSIVE_SCAN</td>
1503228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">AF_CANCEL</td>
1504228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">INACTIVE</td>
1505228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Reset lens position, Lens now locked</td>
1506228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1507228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1508228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">PASSIVE_FOCUSED</td>
1509228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Camera device initiates new scan</td>
1510228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">PASSIVE_SCAN</td>
1511228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Start AF scan, Lens now moving</td>
1512228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1513228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1514228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">PASSIVE_UNFOCUSED</td>
1515228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Camera device initiates new scan</td>
1516228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">PASSIVE_SCAN</td>
1517228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Start AF scan, Lens now moving</td>
1518228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1519228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1520228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">PASSIVE_FOCUSED</td>
1521228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">AF_TRIGGER</td>
1522228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">FOCUSED_LOCKED</td>
1523228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Immediate trans. Lens now locked</td>
1524228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1525228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1526228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">PASSIVE_UNFOCUSED</td>
1527228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">AF_TRIGGER</td>
1528228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">NOT_FOCUSED_LOCKED</td>
1529228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Immediate trans. Lens now locked</td>
1530228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1531228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1532228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">FOCUSED_LOCKED</td>
1533228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">AF_TRIGGER</td>
1534228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">FOCUSED_LOCKED</td>
1535228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">No effect</td>
1536228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1537228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1538228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">FOCUSED_LOCKED</td>
1539228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">AF_CANCEL</td>
1540228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">INACTIVE</td>
1541228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Restart AF scan</td>
1542228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1543228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1544228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">NOT_FOCUSED_LOCKED</td>
1545228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">AF_TRIGGER</td>
1546228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">NOT_FOCUSED_LOCKED</td>
1547228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">No effect</td>
1548228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1549228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1550228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">NOT_FOCUSED_LOCKED</td>
1551228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">AF_CANCEL</td>
1552228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">INACTIVE</td>
1553228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Restart AF scan</td>
1554228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1555228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tbody>
1556228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </table>
155760b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <p>When switch between AF_MODE_CONTINUOUS_* (CAF modes) and AF_MODE_AUTO/AF_MODE_MACRO
155860b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * (AUTO modes), the initial INACTIVE or PASSIVE_SCAN states may be skipped by the
155960b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * camera device. When a trigger is included in a mode switch request, the trigger
156060b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * will be evaluated in the context of the new mode in the request.
156160b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * See below table for examples:</p>
156260b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <table>
156360b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <thead>
156460b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <tr>
156560b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <th align="center">State</th>
156660b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <th align="center">Transition Cause</th>
156760b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <th align="center">New State</th>
156860b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <th align="center">Notes</th>
156960b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * </tr>
157060b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * </thead>
157160b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <tbody>
157260b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <tr>
157360b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">any state</td>
157460b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">CAF--&gt;AUTO mode switch</td>
157560b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">INACTIVE</td>
157660b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">Mode switch without trigger, initial state must be INACTIVE</td>
157760b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * </tr>
157860b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <tr>
157960b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">any state</td>
158060b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">CAF--&gt;AUTO mode switch with AF_TRIGGER</td>
158160b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">trigger-reachable states from INACTIVE</td>
158260b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">Mode switch with trigger, INACTIVE is skipped</td>
158360b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * </tr>
158460b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <tr>
158560b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">any state</td>
158660b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">AUTO--&gt;CAF mode switch</td>
158760b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">passively reachable states from INACTIVE</td>
158860b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">Mode switch without trigger, passive transient state is skipped</td>
158960b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * </tr>
159060b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * </tbody>
159160b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * </table>
1592fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
1593fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
1594fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AF_STATE_INACTIVE INACTIVE}</li>
1595fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AF_STATE_PASSIVE_SCAN PASSIVE_SCAN}</li>
1596fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AF_STATE_PASSIVE_FOCUSED PASSIVE_FOCUSED}</li>
1597fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AF_STATE_ACTIVE_SCAN ACTIVE_SCAN}</li>
1598fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AF_STATE_FOCUSED_LOCKED FOCUSED_LOCKED}</li>
1599fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED NOT_FOCUSED_LOCKED}</li>
1600fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AF_STATE_PASSIVE_UNFOCUSED PASSIVE_UNFOCUSED}</li>
1601fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
16024b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
1603228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     *
1604228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * @see CaptureRequest#CONTROL_AF_MODE
1605228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * @see CaptureRequest#CONTROL_MODE
1606228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * @see CaptureRequest#CONTROL_SCENE_MODE
16075a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AF_STATE_INACTIVE
16085a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AF_STATE_PASSIVE_SCAN
16095a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AF_STATE_PASSIVE_FOCUSED
16105a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AF_STATE_ACTIVE_SCAN
16115a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AF_STATE_FOCUSED_LOCKED
16125a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AF_STATE_NOT_FOCUSED_LOCKED
16139f880f79a3f179443c8b37c3434717432b2ec8d9Eino-Ville Talvala     * @see #CONTROL_AF_STATE_PASSIVE_UNFOCUSED
16145a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
16156c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
16165a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Integer> CONTROL_AF_STATE =
16175a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Integer>("android.control.afState", int.class);
16185a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
16195a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
1620b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <p>Whether auto-white balance (AWB) is currently locked to its
1621379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * latest calculated values.</p>
1622fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>When set to <code>true</code> (ON), the AWB algorithm is locked to its latest parameters,
1623fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * and will not change color balance settings until the lock is set to <code>false</code> (OFF).</p>
1624fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Since the camera device has a pipeline of in-flight requests, the settings that
1625fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * get locked do not necessarily correspond to the settings that were present in the
1626fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * latest capture result received from the camera device, since additional captures
1627fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * and AWB updates may have occurred even before the result was sent out. If an
1628fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * application is switching between automatic and manual control and wishes to eliminate
1629fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * any flicker during the switch, the following procedure is recommended:</p>
1630fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ol>
1631fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <li>Starting in auto-AWB mode:</li>
1632fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <li>Lock AWB</li>
1633fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <li>Wait for the first result to be output that has the AWB locked</li>
1634fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <li>Copy AWB settings from that result into a request, set the request to manual AWB</li>
1635fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <li>Submit the capture request, proceed to run manual AWB as desired.</li>
1636fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ol>
1637e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * <p>Note that AWB lock is only meaningful when
1638e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is in the AUTO mode; in other modes,
1639e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * AWB is already fixed to a specific setting.</p>
16404b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>Some LEGACY devices may not support ON; the value is then overridden to OFF.</p>
16414b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
1642e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     *
1643e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * @see CaptureRequest#CONTROL_AWB_MODE
1644379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     */
16456c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
1646379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He    public static final Key<Boolean> CONTROL_AWB_LOCK =
1647379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He            new Key<Boolean>("android.control.awbLock", boolean.class);
1648379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He
1649379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He    /**
1650b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <p>Whether auto-white balance (AWB) is currently setting the color
16515a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * transform fields, and what its illumination target
1652cc28a41b48bc687002a9e1fc436d00ca6f0c3692Zhijun He     * is.</p>
1653399f05d1e7182ef6c88d30d3b98a467b845ca7c4Zhijun He     * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is AUTO.</p>
1654e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * <p>When set to the ON mode, the camera device's auto-white balance
1655399f05d1e7182ef6c88d30d3b98a467b845ca7c4Zhijun He     * routine is enabled, overriding the application's selected
1656399f05d1e7182ef6c88d30d3b98a467b845ca7c4Zhijun He     * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
16577144b5d2cf445ed245cfd9b09c7897966d01b5ffYin-Chia Yeh     * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}. Note that when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}
16587144b5d2cf445ed245cfd9b09c7897966d01b5ffYin-Chia Yeh     * is OFF, the behavior of AWB is device dependent. It is recommened to
16597144b5d2cf445ed245cfd9b09c7897966d01b5ffYin-Chia Yeh     * also set AWB mode to OFF or lock AWB by using {@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} before
16607144b5d2cf445ed245cfd9b09c7897966d01b5ffYin-Chia Yeh     * setting AE mode to OFF.</p>
1661e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * <p>When set to the OFF mode, the camera device's auto-white balance
1662cc28a41b48bc687002a9e1fc436d00ca6f0c3692Zhijun He     * routine is disabled. The application manually controls the white
1663d8fd67931e17c66e530de5482b63863e6c4301aaEino-Ville Talvala     * balance by {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains}
1664399f05d1e7182ef6c88d30d3b98a467b845ca7c4Zhijun He     * and {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p>
1665e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * <p>When set to any other modes, the camera device's auto-white
1666e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * balance routine is disabled. The camera device uses each
1667e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * particular illumination target for white balance
1668e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * adjustment. The application's values for
1669e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform},
1670e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and
1671e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} are ignored.</p>
1672fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
1673fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
1674fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AWB_MODE_OFF OFF}</li>
1675fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AWB_MODE_AUTO AUTO}</li>
1676fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AWB_MODE_INCANDESCENT INCANDESCENT}</li>
1677fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AWB_MODE_FLUORESCENT FLUORESCENT}</li>
1678fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AWB_MODE_WARM_FLUORESCENT WARM_FLUORESCENT}</li>
1679fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AWB_MODE_DAYLIGHT DAYLIGHT}</li>
1680fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT CLOUDY_DAYLIGHT}</li>
1681fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AWB_MODE_TWILIGHT TWILIGHT}</li>
1682fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AWB_MODE_SHADE SHADE}</li>
1683fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
1684fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Available values for this device:</b><br>
1685fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES android.control.awbAvailableModes}</p>
16864b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
16870da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     *
1688265b34ce331cbe296f82ca357645312718c8d4c7Eino-Ville Talvala     * @see CaptureRequest#COLOR_CORRECTION_GAINS
16895f2a47f3dedfc7859457067d8cdcdbfc28ee08acZhijun He     * @see CaptureRequest#COLOR_CORRECTION_MODE
16905f2a47f3dedfc7859457067d8cdcdbfc28ee08acZhijun He     * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
16917144b5d2cf445ed245cfd9b09c7897966d01b5ffYin-Chia Yeh     * @see CaptureRequest#CONTROL_AE_MODE
1692fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * @see CameraCharacteristics#CONTROL_AWB_AVAILABLE_MODES
16937144b5d2cf445ed245cfd9b09c7897966d01b5ffYin-Chia Yeh     * @see CaptureRequest#CONTROL_AWB_LOCK
1694265b34ce331cbe296f82ca357645312718c8d4c7Eino-Ville Talvala     * @see CaptureRequest#CONTROL_MODE
16955a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AWB_MODE_OFF
16965a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AWB_MODE_AUTO
16975a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AWB_MODE_INCANDESCENT
16985a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AWB_MODE_FLUORESCENT
16995a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT
17005a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AWB_MODE_DAYLIGHT
17015a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT
17025a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AWB_MODE_TWILIGHT
17035a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AWB_MODE_SHADE
17045a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
17056c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
17065a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Integer> CONTROL_AWB_MODE =
17075a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Integer>("android.control.awbMode", int.class);
17085a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
17095a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
1710fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>List of metering areas to use for auto-white-balance illuminant
1711f59521d3b182de217b12e6d4ea31bd32e2418564Ruben Brunk     * estimation.</p>
1712fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Not available if {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb} is 0.
1713808150f066b53da1573e8b1fbd6b377d0fc229f8Yin-Chia Yeh     * Otherwise will always be present.</p>
1714fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>The maximum number of regions supported by the device is determined by the value
1715fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * of {@link CameraCharacteristics#CONTROL_MAX_REGIONS_AWB android.control.maxRegionsAwb}.</p>
1716ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>The coordinate system is based on the active pixel array,
17172629f27362f1a35521501f3a28279ab05b9beb32Timothy Knight     * with (0,0) being the top-left pixel in the active pixel array, and
17180da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1,
17190da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the
172097f1c854993a65b2c700426a1e3a83b23ea65337Yin-Chia Yeh     * bottom-right pixel in the active pixel array.</p>
172197f1c854993a65b2c700426a1e3a83b23ea65337Yin-Chia Yeh     * <p>The weight must range from 0 to 1000, and represents a weight
172297f1c854993a65b2c700426a1e3a83b23ea65337Yin-Chia Yeh     * for every pixel in the area. This means that a large metering area
172397f1c854993a65b2c700426a1e3a83b23ea65337Yin-Chia Yeh     * with the same weight as a smaller area will have more effect in
172497f1c854993a65b2c700426a1e3a83b23ea65337Yin-Chia Yeh     * the metering result. Metering areas can partially overlap and the
172597f1c854993a65b2c700426a1e3a83b23ea65337Yin-Chia Yeh     * camera device will add the weights in the overlap region.</p>
1726fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>The weights are relative to weights of other white balance metering regions, so if
1727fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * only one region is used, all non-zero weights will have the same effect. A region with
1728fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * 0 weight is ignored.</p>
1729fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>If all regions have 0 weight, then no specific metering area needs to be used by the
1730fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * camera device.</p>
1731fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>If the metering region is outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in
1732fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * capture result metadata, the camera device will ignore the sections outside the crop
1733fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * region and output only the intersection rectangle as the metering region in the result
1734fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * metadata.  If the region is entirely outside the crop region, it will be ignored and
1735fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * not reported in the result metadata.</p>
1736fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Units</b>: Pixel coordinates within {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
1737fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
1738fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * Coordinates must be between <code>[(0,0), (width, height))</code> of
1739fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
1740808150f066b53da1573e8b1fbd6b377d0fc229f8Yin-Chia Yeh     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
17410da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     *
1742808150f066b53da1573e8b1fbd6b377d0fc229f8Yin-Chia Yeh     * @see CameraCharacteristics#CONTROL_MAX_REGIONS_AWB
17430da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * @see CaptureRequest#SCALER_CROP_REGION
1744265b34ce331cbe296f82ca357645312718c8d4c7Eino-Ville Talvala     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
17455a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
17466c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
1747817f8933ee1c11130ad2ca45b5ac8ce8b729f125Yin-Chia Yeh    public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS =
1748817f8933ee1c11130ad2ca45b5ac8ce8b729f125Yin-Chia Yeh            new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.awbRegions", android.hardware.camera2.params.MeteringRectangle[].class);
17495a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
17505a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
1751379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <p>Information to the camera device 3A (auto-exposure,
1752379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * auto-focus, auto-white balance) routines about the purpose
1753379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * of this capture, to help the camera device to decide optimal 3A
1754379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * strategy.</p>
1755379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <p>This control (except for MANUAL) is only effective if
1756379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF</code> and any 3A routine is active.</p>
1757e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * <p>ZERO_SHUTTER_LAG will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
17588062d31d27943da4d652878b4c36aeabb8bb8b08Chien-Yu Chen     * contains PRIVATE_REPROCESSING or YUV_REPROCESSING. MANUAL will be supported if
1759513f7c33eae0084ecd70062d660f2b873032d895Zhijun He     * {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains MANUAL_SENSOR. Other intent values are
1760513f7c33eae0084ecd70062d660f2b873032d895Zhijun He     * always supported.</p>
1761fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
1762fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
1763fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_CAPTURE_INTENT_CUSTOM CUSTOM}</li>
1764fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_CAPTURE_INTENT_PREVIEW PREVIEW}</li>
1765fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_CAPTURE_INTENT_STILL_CAPTURE STILL_CAPTURE}</li>
1766fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_RECORD VIDEO_RECORD}</li>
1767fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT VIDEO_SNAPSHOT}</li>
1768fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li>
1769fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_CAPTURE_INTENT_MANUAL MANUAL}</li>
1770fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
1771fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>This key is available on all devices.</p>
1772379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     *
1773379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see CaptureRequest#CONTROL_MODE
1774379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1775379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_CAPTURE_INTENT_CUSTOM
1776379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_CAPTURE_INTENT_PREVIEW
1777379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_CAPTURE_INTENT_STILL_CAPTURE
1778379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_CAPTURE_INTENT_VIDEO_RECORD
1779379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT
1780379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG
1781379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_CAPTURE_INTENT_MANUAL
1782379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     */
17836c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
1784379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He    public static final Key<Integer> CONTROL_CAPTURE_INTENT =
1785379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He            new Key<Integer>("android.control.captureIntent", int.class);
1786379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He
1787379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He    /**
1788b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <p>Current state of auto-white balance (AWB) algorithm.</p>
1789228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <p>Switching between or enabling AWB modes ({@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}) always
1790228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * resets the AWB state to INACTIVE. Similarly, switching between {@link CaptureRequest#CONTROL_MODE android.control.mode},
1791228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * or {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code> resets all
1792228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * the algorithm states to INACTIVE.</p>
1793228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <p>The camera device can do several state transitions between two results, if it is
1794228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * allowed by the state transition table. So INACTIVE may never actually be seen in
1795228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * a result.</p>
1796228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <p>The state in the result is the state for this image (in sync with this image): if
1797228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * AWB state becomes CONVERGED, then the image data associated with this result should
1798228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * be good to use.</p>
1799228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <p>Below are state transition tables for different AWB modes.</p>
1800228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <p>When <code>{@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} != AWB_MODE_AUTO</code>:</p>
1801228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <table>
1802228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <thead>
1803228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1804228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <th align="center">State</th>
1805228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <th align="center">Transition Cause</th>
1806228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <th align="center">New State</th>
1807228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <th align="center">Notes</th>
1808228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1809228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </thead>
1810228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tbody>
1811228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1812228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">INACTIVE</td>
1813228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center"></td>
1814228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">INACTIVE</td>
1815228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Camera device auto white balance algorithm is disabled</td>
1816228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1817228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tbody>
1818228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </table>
1819228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <p>When {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is AWB_MODE_AUTO:</p>
1820228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <table>
1821228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <thead>
1822228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1823228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <th align="center">State</th>
1824228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <th align="center">Transition Cause</th>
1825228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <th align="center">New State</th>
1826228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <th align="center">Notes</th>
1827228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1828228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </thead>
1829228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tbody>
1830228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1831228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">INACTIVE</td>
1832228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Camera device initiates AWB scan</td>
1833228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">SEARCHING</td>
1834228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Values changing</td>
1835228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1836228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1837228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">INACTIVE</td>
1838228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1839228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">LOCKED</td>
1840228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Values locked</td>
1841228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1842228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1843228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">SEARCHING</td>
1844228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Camera device finishes AWB scan</td>
1845228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">CONVERGED</td>
1846228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Good values, not changing</td>
1847228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1848228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1849228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">SEARCHING</td>
1850228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1851228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">LOCKED</td>
1852228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Values locked</td>
1853228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1854228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1855228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">CONVERGED</td>
1856228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Camera device initiates AWB scan</td>
1857228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">SEARCHING</td>
1858228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Values changing</td>
1859228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1860228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1861228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">CONVERGED</td>
1862228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is ON</td>
1863228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">LOCKED</td>
1864228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Values locked</td>
1865228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1866228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1867228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">LOCKED</td>
1868228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
1869228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">SEARCHING</td>
1870228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">Values not good after unlock</td>
1871228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
187260b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * </tbody>
187360b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * </table>
187460b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <p>For the above table, the camera device may skip reporting any state changes that happen
187560b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * without application intervention (i.e. mode switch, trigger, locking). Any state that
187660b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * can be skipped in that manner is called a transient state.</p>
187760b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <p>For example, for this AWB mode (AWB_MODE_AUTO), in addition to the state transitions
187860b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * listed in above table, it is also legal for the camera device to skip one or more
187960b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * transient states between two results. See below table for examples:</p>
188060b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <table>
188160b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <thead>
188260b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <tr>
188360b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <th align="center">State</th>
188460b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <th align="center">Transition Cause</th>
188560b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <th align="center">New State</th>
188660b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <th align="center">Notes</th>
188760b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * </tr>
188860b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * </thead>
188960b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <tbody>
189060b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <tr>
189160b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">INACTIVE</td>
189260b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">Camera device finished AWB scan</td>
189360b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">CONVERGED</td>
189460b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">Values are already good, transient states are skipped by camera device.</td>
189560b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * </tr>
1896228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <tr>
1897228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">LOCKED</td>
1898228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock} is OFF</td>
1899228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * <td align="center">CONVERGED</td>
190060b19dc2df1afef1caf151b9df4cc60af3c395e8Zhijun He     * <td align="center">Values good after unlock, transient states are skipped by camera device.</td>
1901228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tr>
1902228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </tbody>
1903228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * </table>
1904fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
1905fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
1906fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AWB_STATE_INACTIVE INACTIVE}</li>
1907fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AWB_STATE_SEARCHING SEARCHING}</li>
1908fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AWB_STATE_CONVERGED CONVERGED}</li>
1909fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_AWB_STATE_LOCKED LOCKED}</li>
1910fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
19114b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
19124b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Limited capability</b> -
19134b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
19144b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1915228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     *
1916228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * @see CaptureRequest#CONTROL_AWB_LOCK
1917228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * @see CaptureRequest#CONTROL_AWB_MODE
1918228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * @see CaptureRequest#CONTROL_MODE
1919228f4f92e70d9326d473e02bcdcc8faf9e706a4dZhijun He     * @see CaptureRequest#CONTROL_SCENE_MODE
19204b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
19215a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AWB_STATE_INACTIVE
19225a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AWB_STATE_SEARCHING
19235a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AWB_STATE_CONVERGED
19245a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_AWB_STATE_LOCKED
19255a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
19266c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
19275a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Integer> CONTROL_AWB_STATE =
19285a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Integer>("android.control.awbState", int.class);
19295a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
19305a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
1931379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <p>A special color effect to apply.</p>
1932379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <p>When this mode is set, a color effect will be applied
1933379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * to images produced by the camera device. The interpretation
1934379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * and implementation of these color effects is left to the
1935379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * implementor of the camera device, and should not be
1936379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * depended on to be consistent (or present) across all
1937379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * devices.</p>
1938fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
1939fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
1940fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_EFFECT_MODE_OFF OFF}</li>
1941fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_EFFECT_MODE_MONO MONO}</li>
1942fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_EFFECT_MODE_NEGATIVE NEGATIVE}</li>
1943fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_EFFECT_MODE_SOLARIZE SOLARIZE}</li>
1944fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_EFFECT_MODE_SEPIA SEPIA}</li>
1945fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_EFFECT_MODE_POSTERIZE POSTERIZE}</li>
1946fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_EFFECT_MODE_WHITEBOARD WHITEBOARD}</li>
1947fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_EFFECT_MODE_BLACKBOARD BLACKBOARD}</li>
1948fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_EFFECT_MODE_AQUA AQUA}</li>
1949fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
1950fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Available values for this device:</b><br>
1951fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS android.control.availableEffects}</p>
19524b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
1953379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     *
1954fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * @see CameraCharacteristics#CONTROL_AVAILABLE_EFFECTS
1955379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_EFFECT_MODE_OFF
1956379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_EFFECT_MODE_MONO
1957379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_EFFECT_MODE_NEGATIVE
1958379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_EFFECT_MODE_SOLARIZE
1959379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_EFFECT_MODE_SEPIA
1960379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_EFFECT_MODE_POSTERIZE
1961379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_EFFECT_MODE_WHITEBOARD
1962379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_EFFECT_MODE_BLACKBOARD
1963379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_EFFECT_MODE_AQUA
1964379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     */
19656c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
1966379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He    public static final Key<Integer> CONTROL_EFFECT_MODE =
1967379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He            new Key<Integer>("android.control.effectMode", int.class);
1968379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He
1969379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He    /**
1970fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Overall mode of 3A (auto-exposure, auto-white-balance, auto-focus) control
1971cc28a41b48bc687002a9e1fc436d00ca6f0c3692Zhijun He     * routines.</p>
1972fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>This is a top-level 3A control switch. When set to OFF, all 3A control
19735f2a47f3dedfc7859457067d8cdcdbfc28ee08acZhijun He     * by the camera device is disabled. The application must set the fields for
1974f353742124af698098884b4172644af0851b30caZhijun He     * capture parameters itself.</p>
1975f353742124af698098884b4172644af0851b30caZhijun He     * <p>When set to AUTO, the individual algorithm controls in
19760da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p>
1977f353742124af698098884b4172644af0851b30caZhijun He     * <p>When set to USE_SCENE_MODE, the individual controls in
19785f2a47f3dedfc7859457067d8cdcdbfc28ee08acZhijun He     * android.control.* are mostly disabled, and the camera device implements
1979f353742124af698098884b4172644af0851b30caZhijun He     * one of the scene mode settings (such as ACTION, SUNSET, or PARTY)
19805f2a47f3dedfc7859457067d8cdcdbfc28ee08acZhijun He     * as it wishes. The camera device scene mode 3A settings are provided by
1981527d522f349d806fa9765130269de5a759cb6b69Zhijun He     * {@link android.hardware.camera2.CaptureResult capture results}.</p>
19822d5e89778e955b4ff209a93e738761356349d48cZhijun He     * <p>When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference
19832d5e89778e955b4ff209a93e738761356349d48cZhijun He     * is that this frame will not be used by camera device background 3A statistics
19842d5e89778e955b4ff209a93e738761356349d48cZhijun He     * update, as if this frame is never captured. This mode can be used in the scenario
19852d5e89778e955b4ff209a93e738761356349d48cZhijun He     * where the application doesn't want a 3A manual control capture to affect
19862d5e89778e955b4ff209a93e738761356349d48cZhijun He     * the subsequent auto 3A capture results.</p>
1987fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
1988fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
1989fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_MODE_OFF OFF}</li>
1990fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_MODE_AUTO AUTO}</li>
1991fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_MODE_USE_SCENE_MODE USE_SCENE_MODE}</li>
1992fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_MODE_OFF_KEEP_STATE OFF_KEEP_STATE}</li>
1993fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
1994d9fc67ce3c1498a911df39675b61b96ec1364f08Yin-Chia Yeh     * <p><b>Available values for this device:</b><br>
1995d9fc67ce3c1498a911df39675b61b96ec1364f08Yin-Chia Yeh     * {@link CameraCharacteristics#CONTROL_AVAILABLE_MODES android.control.availableModes}</p>
19964b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
19970da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     *
19980da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * @see CaptureRequest#CONTROL_AF_MODE
1999d9fc67ce3c1498a911df39675b61b96ec1364f08Yin-Chia Yeh     * @see CameraCharacteristics#CONTROL_AVAILABLE_MODES
20005a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_MODE_OFF
20015a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_MODE_AUTO
20025a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #CONTROL_MODE_USE_SCENE_MODE
20032d5e89778e955b4ff209a93e738761356349d48cZhijun He     * @see #CONTROL_MODE_OFF_KEEP_STATE
20045a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
20056c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
20065a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Integer> CONTROL_MODE =
20075a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Integer>("android.control.mode", int.class);
20085a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
20095a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
2010fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Control for which scene mode is currently active.</p>
2011fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Scene modes are custom camera modes optimized for a certain set of conditions and
2012fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * capture settings.</p>
2013379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <p>This is the mode that that is active when
2014ee2ebdedccaa708cfe810c50cc047990cc2054c5Zhijun He     * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code>. Aside from FACE_PRIORITY, these modes will
2015ee2ebdedccaa708cfe810c50cc047990cc2054c5Zhijun He     * disable {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}, {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, and {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}
2016ee2ebdedccaa708cfe810c50cc047990cc2054c5Zhijun He     * while in use.</p>
2017379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <p>The interpretation and implementation of these scene modes is left
2018379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * to the implementor of the camera device. Their behavior will not be
2019379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * consistent across all devices, and any given device may only implement
2020379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * a subset of these modes.</p>
2021fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
2022fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
2023fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_SCENE_MODE_DISABLED DISABLED}</li>
2024fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_SCENE_MODE_FACE_PRIORITY FACE_PRIORITY}</li>
2025fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_SCENE_MODE_ACTION ACTION}</li>
2026fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_SCENE_MODE_PORTRAIT PORTRAIT}</li>
2027fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_SCENE_MODE_LANDSCAPE LANDSCAPE}</li>
2028fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_SCENE_MODE_NIGHT NIGHT}</li>
2029fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_SCENE_MODE_NIGHT_PORTRAIT NIGHT_PORTRAIT}</li>
2030fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_SCENE_MODE_THEATRE THEATRE}</li>
2031fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_SCENE_MODE_BEACH BEACH}</li>
2032fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_SCENE_MODE_SNOW SNOW}</li>
2033fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_SCENE_MODE_SUNSET SUNSET}</li>
2034fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_SCENE_MODE_STEADYPHOTO STEADYPHOTO}</li>
2035fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_SCENE_MODE_FIREWORKS FIREWORKS}</li>
2036fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_SCENE_MODE_SPORTS SPORTS}</li>
2037fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_SCENE_MODE_PARTY PARTY}</li>
2038fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_SCENE_MODE_CANDLELIGHT CANDLELIGHT}</li>
2039fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_SCENE_MODE_BARCODE BARCODE}</li>
2040fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO HIGH_SPEED_VIDEO}</li>
2041f4eac129545fd583d33d9e7ab05cc87f61079bb9Eino-Ville Talvala     *   <li>{@link #CONTROL_SCENE_MODE_HDR HDR}</li>
2042fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
2043fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Available values for this device:</b><br>
2044fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES android.control.availableSceneModes}</p>
20454b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
2046379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     *
2047379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see CaptureRequest#CONTROL_AE_MODE
2048379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see CaptureRequest#CONTROL_AF_MODE
2049e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * @see CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES
2050379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see CaptureRequest#CONTROL_AWB_MODE
2051379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see CaptureRequest#CONTROL_MODE
2052379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_SCENE_MODE_DISABLED
2053379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_SCENE_MODE_FACE_PRIORITY
2054379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_SCENE_MODE_ACTION
2055379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_SCENE_MODE_PORTRAIT
2056379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_SCENE_MODE_LANDSCAPE
2057379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_SCENE_MODE_NIGHT
2058379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_SCENE_MODE_NIGHT_PORTRAIT
2059379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_SCENE_MODE_THEATRE
2060379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_SCENE_MODE_BEACH
2061379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_SCENE_MODE_SNOW
2062379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_SCENE_MODE_SUNSET
2063379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_SCENE_MODE_STEADYPHOTO
2064379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_SCENE_MODE_FIREWORKS
2065379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_SCENE_MODE_SPORTS
2066379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_SCENE_MODE_PARTY
2067379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_SCENE_MODE_CANDLELIGHT
2068379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_SCENE_MODE_BARCODE
2069e040418f4779c37aa9df69a3916d376af9d2e868Zhijun He     * @see #CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO
2070f4eac129545fd583d33d9e7ab05cc87f61079bb9Eino-Ville Talvala     * @see #CONTROL_SCENE_MODE_HDR
2071379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     */
20726c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
2073379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He    public static final Key<Integer> CONTROL_SCENE_MODE =
2074379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He            new Key<Integer>("android.control.sceneMode", int.class);
2075379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He
2076379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He    /**
2077379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <p>Whether video stabilization is
2078b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * active.</p>
20792813b0fae99fed1096dc23c3899e223459a54cecJianing Wei     * <p>Video stabilization automatically warps images from
2080fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * the camera in order to stabilize motion between consecutive frames.</p>
2081379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <p>If enabled, video stabilization can modify the
208245fa43a1815e2d0a25ed3a126e4e732a03b7ed7fZhijun He     * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to keep the video stream stabilized.</p>
2083fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Switching between different video stabilization modes may take several
2084fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * frames to initialize, the camera device will report the current mode
2085fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * in capture result metadata. For example, When "ON" mode is requested,
2086fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * the video stabilization modes in the first several capture results may
2087fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * still be "OFF", and it will become "ON" when the initialization is
2088fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * done.</p>
20892813b0fae99fed1096dc23c3899e223459a54cecJianing Wei     * <p>In addition, not all recording sizes or frame rates may be supported for
20902813b0fae99fed1096dc23c3899e223459a54cecJianing Wei     * stabilization by a device that reports stabilization support. It is guaranteed
20912813b0fae99fed1096dc23c3899e223459a54cecJianing Wei     * that an output targeting a MediaRecorder or MediaCodec will be stabilized if
20922813b0fae99fed1096dc23c3899e223459a54cecJianing Wei     * the recording resolution is less than or equal to 1920 x 1080 (width less than
20932813b0fae99fed1096dc23c3899e223459a54cecJianing Wei     * or equal to 1920, height less than or equal to 1080), and the recording
20942813b0fae99fed1096dc23c3899e223459a54cecJianing Wei     * frame rate is less than or equal to 30fps.  At other sizes, the CaptureResult
20952813b0fae99fed1096dc23c3899e223459a54cecJianing Wei     * {@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode} field will return
20962813b0fae99fed1096dc23c3899e223459a54cecJianing Wei     * OFF if the recording output is not stabilized, or if there are no output
20972813b0fae99fed1096dc23c3899e223459a54cecJianing Wei     * Surface types that can be stabilized.</p>
2098fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>If a camera device supports both this mode and OIS
2099fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * ({@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}), turning both modes on may
2100fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * produce undesirable interaction, so it is recommended not to enable
2101fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * both at the same time.</p>
2102fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
2103fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
2104fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_OFF OFF}</li>
2105fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #CONTROL_VIDEO_STABILIZATION_MODE_ON ON}</li>
2106fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
21074b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
2108379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     *
21092813b0fae99fed1096dc23c3899e223459a54cecJianing Wei     * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
211045fa43a1815e2d0a25ed3a126e4e732a03b7ed7fZhijun He     * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
2111379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see CaptureRequest#SCALER_CROP_REGION
2112379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_VIDEO_STABILIZATION_MODE_OFF
2113379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #CONTROL_VIDEO_STABILIZATION_MODE_ON
2114379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     */
21156c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
2116379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He    public static final Key<Integer> CONTROL_VIDEO_STABILIZATION_MODE =
2117379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He            new Key<Integer>("android.control.videoStabilizationMode", int.class);
2118379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He
2119379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He    /**
212033052d3359afe52514987298bc0b7cb1436247a5Yin-Chia Yeh     * <p>The amount of additional sensitivity boost applied to output images
21211ee1a0ae60c1e7acd4f334f9a31c67ae4e40f73aYin-Chia Yeh     * after RAW sensor data is captured.</p>
21221ee1a0ae60c1e7acd4f334f9a31c67ae4e40f73aYin-Chia Yeh     * <p>Some camera devices support additional digital sensitivity boosting in the
21231ee1a0ae60c1e7acd4f334f9a31c67ae4e40f73aYin-Chia Yeh     * camera processing pipeline after sensor RAW image is captured.
21241ee1a0ae60c1e7acd4f334f9a31c67ae4e40f73aYin-Chia Yeh     * Such a boost will be applied to YUV/JPEG format output images but will not
21251ee1a0ae60c1e7acd4f334f9a31c67ae4e40f73aYin-Chia Yeh     * have effect on RAW output formats like RAW_SENSOR, RAW10, RAW12 or RAW_OPAQUE.</p>
212633052d3359afe52514987298bc0b7cb1436247a5Yin-Chia Yeh     * <p>This key will be <code>null</code> for devices that do not support any RAW format
212733052d3359afe52514987298bc0b7cb1436247a5Yin-Chia Yeh     * outputs. For devices that do support RAW format outputs, this key will always
212833052d3359afe52514987298bc0b7cb1436247a5Yin-Chia Yeh     * present, and if a device does not support post RAW sensitivity boost, it will
212933052d3359afe52514987298bc0b7cb1436247a5Yin-Chia Yeh     * list <code>100</code> in this key.</p>
21301ee1a0ae60c1e7acd4f334f9a31c67ae4e40f73aYin-Chia Yeh     * <p>If the camera device cannot apply the exact boost requested, it will reduce the
21311ee1a0ae60c1e7acd4f334f9a31c67ae4e40f73aYin-Chia Yeh     * boost to the nearest supported value.
21321ee1a0ae60c1e7acd4f334f9a31c67ae4e40f73aYin-Chia Yeh     * The final boost value used will be available in the output capture result.</p>
21331ee1a0ae60c1e7acd4f334f9a31c67ae4e40f73aYin-Chia Yeh     * <p>For devices that support post RAW sensitivity boost, the YUV/JPEG output images
21341ee1a0ae60c1e7acd4f334f9a31c67ae4e40f73aYin-Chia Yeh     * of such device will have the total sensitivity of
213567e61b6d222e310148e196fab4801dd8298efb5eYin-Chia Yeh     * <code>{@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity} * {@link CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST android.control.postRawSensitivityBoost} / 100</code>
21361ee1a0ae60c1e7acd4f334f9a31c67ae4e40f73aYin-Chia Yeh     * The sensitivity of RAW format images will always be <code>{@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}</code></p>
21371ee1a0ae60c1e7acd4f334f9a31c67ae4e40f73aYin-Chia Yeh     * <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
21381ee1a0ae60c1e7acd4f334f9a31c67ae4e40f73aYin-Chia Yeh     * OFF; otherwise the auto-exposure algorithm will override this value.</p>
21391ee1a0ae60c1e7acd4f334f9a31c67ae4e40f73aYin-Chia Yeh     * <p><b>Units</b>: ISO arithmetic units, the same as {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}</p>
21401ee1a0ae60c1e7acd4f334f9a31c67ae4e40f73aYin-Chia Yeh     * <p><b>Range of valid values:</b><br>
21411ee1a0ae60c1e7acd4f334f9a31c67ae4e40f73aYin-Chia Yeh     * {@link CameraCharacteristics#CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE android.control.postRawSensitivityBoostRange}</p>
21421ee1a0ae60c1e7acd4f334f9a31c67ae4e40f73aYin-Chia Yeh     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
21431ee1a0ae60c1e7acd4f334f9a31c67ae4e40f73aYin-Chia Yeh     *
21441ee1a0ae60c1e7acd4f334f9a31c67ae4e40f73aYin-Chia Yeh     * @see CaptureRequest#CONTROL_AE_MODE
21451ee1a0ae60c1e7acd4f334f9a31c67ae4e40f73aYin-Chia Yeh     * @see CaptureRequest#CONTROL_MODE
21461ee1a0ae60c1e7acd4f334f9a31c67ae4e40f73aYin-Chia Yeh     * @see CaptureRequest#CONTROL_POST_RAW_SENSITIVITY_BOOST
21471ee1a0ae60c1e7acd4f334f9a31c67ae4e40f73aYin-Chia Yeh     * @see CameraCharacteristics#CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE
21481ee1a0ae60c1e7acd4f334f9a31c67ae4e40f73aYin-Chia Yeh     * @see CaptureRequest#SENSOR_SENSITIVITY
21491ee1a0ae60c1e7acd4f334f9a31c67ae4e40f73aYin-Chia Yeh     */
21501ee1a0ae60c1e7acd4f334f9a31c67ae4e40f73aYin-Chia Yeh    @PublicKey
21511ee1a0ae60c1e7acd4f334f9a31c67ae4e40f73aYin-Chia Yeh    public static final Key<Integer> CONTROL_POST_RAW_SENSITIVITY_BOOST =
21521ee1a0ae60c1e7acd4f334f9a31c67ae4e40f73aYin-Chia Yeh            new Key<Integer>("android.control.postRawSensitivityBoost", int.class);
21531ee1a0ae60c1e7acd4f334f9a31c67ae4e40f73aYin-Chia Yeh
21541ee1a0ae60c1e7acd4f334f9a31c67ae4e40f73aYin-Chia Yeh    /**
2155e449171fc15aba2928a6e267a7214edbb470e812Chien-Yu Chen     * <p>Allow camera device to enable zero-shutter-lag mode for requests with
2156e449171fc15aba2928a6e267a7214edbb470e812Chien-Yu Chen     * {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} == STILL_CAPTURE.</p>
2157e449171fc15aba2928a6e267a7214edbb470e812Chien-Yu Chen     * <p>If enableZsl is <code>true</code>, the camera device may enable zero-shutter-lag mode for requests with
2158e449171fc15aba2928a6e267a7214edbb470e812Chien-Yu Chen     * STILL_CAPTURE capture intent. The camera device may use images captured in the past to
2159e449171fc15aba2928a6e267a7214edbb470e812Chien-Yu Chen     * produce output images for a zero-shutter-lag request. The result metadata including the
2160e449171fc15aba2928a6e267a7214edbb470e812Chien-Yu Chen     * {@link CaptureResult#SENSOR_TIMESTAMP android.sensor.timestamp} reflects the source frames used to produce output images.
2161e449171fc15aba2928a6e267a7214edbb470e812Chien-Yu Chen     * Therefore, the contents of the output images and the result metadata may be out of order
2162e449171fc15aba2928a6e267a7214edbb470e812Chien-Yu Chen     * compared to previous regular requests. enableZsl does not affect requests with other
2163e449171fc15aba2928a6e267a7214edbb470e812Chien-Yu Chen     * capture intents.</p>
2164e449171fc15aba2928a6e267a7214edbb470e812Chien-Yu Chen     * <p>For example, when requests are submitted in the following order:
2165e449171fc15aba2928a6e267a7214edbb470e812Chien-Yu Chen     *   Request A: enableZsl is ON, {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} is PREVIEW
2166e449171fc15aba2928a6e267a7214edbb470e812Chien-Yu Chen     *   Request B: enableZsl is ON, {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} is STILL_CAPTURE</p>
2167e449171fc15aba2928a6e267a7214edbb470e812Chien-Yu Chen     * <p>The output images for request B may have contents captured before the output images for
2168e449171fc15aba2928a6e267a7214edbb470e812Chien-Yu Chen     * request A, and the result metadata for request B may be older than the result metadata for
2169e449171fc15aba2928a6e267a7214edbb470e812Chien-Yu Chen     * request A.</p>
21701d72ee3b85a31b62a1a088e72c296f29b435d1d2Chien-Yu Chen     * <p>Note that when enableZsl is <code>true</code>, it is not guaranteed to get output images captured in
21711d72ee3b85a31b62a1a088e72c296f29b435d1d2Chien-Yu Chen     * the past for requests with STILL_CAPTURE capture intent.</p>
21721d72ee3b85a31b62a1a088e72c296f29b435d1d2Chien-Yu Chen     * <p>For applications targeting SDK versions O and newer, the value of enableZsl in
21731d72ee3b85a31b62a1a088e72c296f29b435d1d2Chien-Yu Chen     * TEMPLATE_STILL_CAPTURE template may be <code>true</code>. The value in other templates is always
21741d72ee3b85a31b62a1a088e72c296f29b435d1d2Chien-Yu Chen     * <code>false</code> if present.</p>
21751d72ee3b85a31b62a1a088e72c296f29b435d1d2Chien-Yu Chen     * <p>For applications targeting SDK versions older than O, the value of enableZsl in all
21761d72ee3b85a31b62a1a088e72c296f29b435d1d2Chien-Yu Chen     * capture templates is always <code>false</code> if present.</p>
21778102638c714a0c6c201d764f4a54002c21be1a63Chien-Yu Chen     * <p>For application-operated ZSL, use CAMERA3_TEMPLATE_ZERO_SHUTTER_LAG template.</p>
2178e449171fc15aba2928a6e267a7214edbb470e812Chien-Yu Chen     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2179e449171fc15aba2928a6e267a7214edbb470e812Chien-Yu Chen     *
2180e449171fc15aba2928a6e267a7214edbb470e812Chien-Yu Chen     * @see CaptureRequest#CONTROL_CAPTURE_INTENT
2181e449171fc15aba2928a6e267a7214edbb470e812Chien-Yu Chen     * @see CaptureResult#SENSOR_TIMESTAMP
2182e449171fc15aba2928a6e267a7214edbb470e812Chien-Yu Chen     */
2183e449171fc15aba2928a6e267a7214edbb470e812Chien-Yu Chen    @PublicKey
2184e449171fc15aba2928a6e267a7214edbb470e812Chien-Yu Chen    public static final Key<Boolean> CONTROL_ENABLE_ZSL =
2185e449171fc15aba2928a6e267a7214edbb470e812Chien-Yu Chen            new Key<Boolean>("android.control.enableZsl", boolean.class);
2186e449171fc15aba2928a6e267a7214edbb470e812Chien-Yu Chen
2187e449171fc15aba2928a6e267a7214edbb470e812Chien-Yu Chen    /**
2188ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>Operation mode for edge
2189cc28a41b48bc687002a9e1fc436d00ca6f0c3692Zhijun He     * enhancement.</p>
2190fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Edge enhancement improves sharpness and details in the captured image. OFF means
2191fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * no enhancement will be applied by the camera device.</p>
21925f2a47f3dedfc7859457067d8cdcdbfc28ee08acZhijun He     * <p>FAST/HIGH_QUALITY both mean camera device determined enhancement
21932807936f5dfdeff25e9ace3482100511a69dcf13Zhijun He     * will be applied. HIGH_QUALITY mode indicates that the
21945f2a47f3dedfc7859457067d8cdcdbfc28ee08acZhijun He     * camera device will use the highest-quality enhancement algorithms,
21955f2a47f3dedfc7859457067d8cdcdbfc28ee08acZhijun He     * even if it slows down capture rate. FAST means the camera device will
21969c9167efe229f2d7bad0422c371923d5d1776f52Chien-Yu Chen     * not slow down capture rate when applying edge enhancement. FAST may be the same as OFF if
21979c9167efe229f2d7bad0422c371923d5d1776f52Chien-Yu Chen     * edge enhancement will slow down capture rate. Every output stream will have a similar
21989c9167efe229f2d7bad0422c371923d5d1776f52Chien-Yu Chen     * amount of enhancement applied.</p>
21990dd17509a953774039c0e73beac4b0546504c774Eino-Ville Talvala     * <p>ZERO_SHUTTER_LAG is meant to be used by applications that maintain a continuous circular
22000dd17509a953774039c0e73beac4b0546504c774Eino-Ville Talvala     * buffer of high-resolution images during preview and reprocess image(s) from that buffer
22010dd17509a953774039c0e73beac4b0546504c774Eino-Ville Talvala     * into a final capture when triggered by the user. In this mode, the camera device applies
22020dd17509a953774039c0e73beac4b0546504c774Eino-Ville Talvala     * edge enhancement to low-resolution streams (below maximum recording resolution) to
22030dd17509a953774039c0e73beac4b0546504c774Eino-Ville Talvala     * maximize preview quality, but does not apply edge enhancement to high-resolution streams,
22040dd17509a953774039c0e73beac4b0546504c774Eino-Ville Talvala     * since those will be reprocessed later if necessary.</p>
22050e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera
22060e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * device will apply FAST/HIGH_QUALITY YUV-domain edge enhancement, respectively.
22079c9167efe229f2d7bad0422c371923d5d1776f52Chien-Yu Chen     * The camera device may adjust its internal edge enhancement parameters for best
22080e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * image quality based on the {@link CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR android.reprocess.effectiveExposureFactor}, if it is set.</p>
2209fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
2210fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
2211fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #EDGE_MODE_OFF OFF}</li>
2212fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #EDGE_MODE_FAST FAST}</li>
2213fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #EDGE_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
22140dd17509a953774039c0e73beac4b0546504c774Eino-Ville Talvala     *   <li>{@link #EDGE_MODE_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li>
2215fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
2216fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Available values for this device:</b><br>
2217fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES android.edge.availableEdgeModes}</p>
22184b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
22194b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Full capability</b> -
22204b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
22214b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
22226dc379c7bd34d9707ee2ef819a5a07afc2aa9314Ruben Brunk     *
22236dc379c7bd34d9707ee2ef819a5a07afc2aa9314Ruben Brunk     * @see CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES
22244b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
22250e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR
22265a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #EDGE_MODE_OFF
22275a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #EDGE_MODE_FAST
22285a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #EDGE_MODE_HIGH_QUALITY
22290dd17509a953774039c0e73beac4b0546504c774Eino-Ville Talvala     * @see #EDGE_MODE_ZERO_SHUTTER_LAG
22305a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
22316c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
22325a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Integer> EDGE_MODE =
22335a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Integer>("android.edge.mode", int.class);
22345a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
22355a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
223666d065a6d48cafe390c697c77b44ba5196ee0870Zhijun He     * <p>The desired mode for for the camera device's flash control.</p>
223766d065a6d48cafe390c697c77b44ba5196ee0870Zhijun He     * <p>This control is only effective when flash unit is available
2238153ac102d36df66853b523ab01763dc457972517Zhijun He     * (<code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == true</code>).</p>
223966d065a6d48cafe390c697c77b44ba5196ee0870Zhijun He     * <p>When this control is used, the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} must be set to ON or OFF.
224066d065a6d48cafe390c697c77b44ba5196ee0870Zhijun He     * Otherwise, the camera device auto-exposure related flash control (ON_AUTO_FLASH,
224166d065a6d48cafe390c697c77b44ba5196ee0870Zhijun He     * ON_ALWAYS_FLASH, or ON_AUTO_FLASH_REDEYE) will override this control.</p>
224266d065a6d48cafe390c697c77b44ba5196ee0870Zhijun He     * <p>When set to OFF, the camera device will not fire flash for this capture.</p>
224366d065a6d48cafe390c697c77b44ba5196ee0870Zhijun He     * <p>When set to SINGLE, the camera device will fire flash regardless of the camera
224466d065a6d48cafe390c697c77b44ba5196ee0870Zhijun He     * device's auto-exposure routine's result. When used in still capture case, this
2245b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * control should be used along with auto-exposure (AE) precapture metering sequence
224666d065a6d48cafe390c697c77b44ba5196ee0870Zhijun He     * ({@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}), otherwise, the image may be incorrectly exposed.</p>
224766d065a6d48cafe390c697c77b44ba5196ee0870Zhijun He     * <p>When set to TORCH, the flash will be on continuously. This mode can be used
224866d065a6d48cafe390c697c77b44ba5196ee0870Zhijun He     * for use cases such as preview, auto-focus assist, still capture, or video recording.</p>
2249ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * <p>The flash status will be reported by {@link CaptureResult#FLASH_STATE android.flash.state} in the capture result metadata.</p>
2250fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
2251fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
2252fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #FLASH_MODE_OFF OFF}</li>
2253fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #FLASH_MODE_SINGLE SINGLE}</li>
2254fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #FLASH_MODE_TORCH TORCH}</li>
2255fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
22564b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
225766d065a6d48cafe390c697c77b44ba5196ee0870Zhijun He     *
225866d065a6d48cafe390c697c77b44ba5196ee0870Zhijun He     * @see CaptureRequest#CONTROL_AE_MODE
225966d065a6d48cafe390c697c77b44ba5196ee0870Zhijun He     * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
226066d065a6d48cafe390c697c77b44ba5196ee0870Zhijun He     * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
2261ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * @see CaptureResult#FLASH_STATE
22625a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #FLASH_MODE_OFF
22635a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #FLASH_MODE_SINGLE
22645a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #FLASH_MODE_TORCH
22655a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
22666c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
22675a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Integer> FLASH_MODE =
22685a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Integer>("android.flash.mode", int.class);
22695a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
22705a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
2271ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>Current state of the flash
2272ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * unit.</p>
2273ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * <p>When the camera device doesn't have flash unit
2274ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * (i.e. <code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == false</code>), this state will always be UNAVAILABLE.
2275ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * Other states indicate the current flash status.</p>
22764b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>In certain conditions, this will be available on LEGACY devices:</p>
22774b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <ul>
22784b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <li>Flash-less cameras always return UNAVAILABLE.</li>
22794b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <li>Using {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>==</code> ON_ALWAYS_FLASH
2280fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *    will always return FIRED.</li>
22814b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <li>Using {@link CaptureRequest#FLASH_MODE android.flash.mode} <code>==</code> TORCH
2282fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *    will always return FIRED.</li>
22834b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * </ul>
22844b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>In all other conditions the state will not be available on
22854b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * LEGACY devices (i.e. it will be <code>null</code>).</p>
2286fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
2287fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
2288fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #FLASH_STATE_UNAVAILABLE UNAVAILABLE}</li>
2289fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #FLASH_STATE_CHARGING CHARGING}</li>
2290fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #FLASH_STATE_READY READY}</li>
2291fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #FLASH_STATE_FIRED FIRED}</li>
2292fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #FLASH_STATE_PARTIAL PARTIAL}</li>
2293fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
22944b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
22954b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Limited capability</b> -
22964b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
22974b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2298ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     *
22994b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CaptureRequest#CONTROL_AE_MODE
2300ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * @see CameraCharacteristics#FLASH_INFO_AVAILABLE
23014b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CaptureRequest#FLASH_MODE
23024b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
23035a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #FLASH_STATE_UNAVAILABLE
23045a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #FLASH_STATE_CHARGING
23055a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #FLASH_STATE_READY
23065a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #FLASH_STATE_FIRED
23078dda7273dbb4ff6eeffe7d4c3831e9b31b8e5ac1Zhijun He     * @see #FLASH_STATE_PARTIAL
23085a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
23096c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
23105a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Integer> FLASH_STATE =
23115a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Integer>("android.flash.state", int.class);
23125a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
23135a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
2314fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Operational mode for hot pixel correction.</p>
2315eba1b3a843278a92611edf153faa41a01d793b25Ruben Brunk     * <p>Hotpixel correction interpolates out, or otherwise removes, pixels
2316fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * that do not accurately measure the incoming light (i.e. pixels that
2317fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * are stuck at an arbitrary value or are oversensitive).</p>
2318fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
2319fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
2320fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #HOT_PIXEL_MODE_OFF OFF}</li>
2321fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #HOT_PIXEL_MODE_FAST FAST}</li>
2322fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #HOT_PIXEL_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
2323fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
2324fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Available values for this device:</b><br>
2325fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES android.hotPixel.availableHotPixelModes}</p>
23264b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
23279d454fd6096dad310a476d50b5e7175e38cdc4eaRuben Brunk     *
23289d454fd6096dad310a476d50b5e7175e38cdc4eaRuben Brunk     * @see CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES
2329eba1b3a843278a92611edf153faa41a01d793b25Ruben Brunk     * @see #HOT_PIXEL_MODE_OFF
2330eba1b3a843278a92611edf153faa41a01d793b25Ruben Brunk     * @see #HOT_PIXEL_MODE_FAST
2331eba1b3a843278a92611edf153faa41a01d793b25Ruben Brunk     * @see #HOT_PIXEL_MODE_HIGH_QUALITY
2332eba1b3a843278a92611edf153faa41a01d793b25Ruben Brunk     */
23336c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
2334eba1b3a843278a92611edf153faa41a01d793b25Ruben Brunk    public static final Key<Integer> HOT_PIXEL_MODE =
2335eba1b3a843278a92611edf153faa41a01d793b25Ruben Brunk            new Key<Integer>("android.hotPixel.mode", int.class);
2336eba1b3a843278a92611edf153faa41a01d793b25Ruben Brunk
2337eba1b3a843278a92611edf153faa41a01d793b25Ruben Brunk    /**
2338574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     * <p>A location object to use when generating image GPS metadata.</p>
2339fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Setting a location object in a request will include the GPS coordinates of the location
2340fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * into any JPEG images captured based on the request. These coordinates can then be
2341fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * viewed by anyone who receives the JPEG image.</p>
23424b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
2343574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     */
23446c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
23456c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @SyntheticKey
2346574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk    public static final Key<android.location.Location> JPEG_GPS_LOCATION =
2347574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk            new Key<android.location.Location>("android.jpeg.gpsLocation", android.location.Location.class);
2348574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk
2349574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk    /**
2350ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>GPS coordinates to include in output JPEG
2351fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * EXIF.</p>
2352fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
2353fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * (-180 - 180], [-90,90], [-inf, inf]</p>
23544b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
2355574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     * @hide
23565a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
23575a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<double[]> JPEG_GPS_COORDINATES =
23585a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<double[]>("android.jpeg.gpsCoordinates", double[].class);
23595a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
23605a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
2361ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>32 characters describing GPS algorithm to
2362fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * include in EXIF.</p>
2363fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Units</b>: UTF-8 null-terminated string</p>
23644b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
2365574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     * @hide
23665a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
23675a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<String> JPEG_GPS_PROCESSING_METHOD =
23685a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<String>("android.jpeg.gpsProcessingMethod", String.class);
23695a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
23705a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
2371ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>Time GPS fix was made to include in
2372fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * EXIF.</p>
2373fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Units</b>: UTC in seconds since January 1, 1970</p>
23744b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
2375574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     * @hide
23765a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
23775a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Long> JPEG_GPS_TIMESTAMP =
23785a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Long>("android.jpeg.gpsTimestamp", long.class);
23795a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
23805a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
2381fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>The orientation for a JPEG image.</p>
2382fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>The clockwise rotation angle in degrees, relative to the orientation
2383fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * to the camera, that the JPEG picture needs to be rotated by, to be viewed
2384fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * upright.</p>
2385fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Camera devices may either encode this value into the JPEG EXIF header, or
2386d49ebcc3ad3d37d9c37e638db5d308c9c22c30fbYin-Chia Yeh     * rotate the image data to match this orientation. When the image data is rotated,
2387d49ebcc3ad3d37d9c37e638db5d308c9c22c30fbYin-Chia Yeh     * the thumbnail data will also be rotated.</p>
2388fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Note that this orientation is relative to the orientation of the camera sensor, given
2389fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * by {@link CameraCharacteristics#SENSOR_ORIENTATION android.sensor.orientation}.</p>
2390fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>To translate from the device orientation given by the Android sensor APIs, the following
2391fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * sample code may be used:</p>
2392fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <pre><code>private int getJpegOrientation(CameraCharacteristics c, int deviceOrientation) {
2393fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *     if (deviceOrientation == android.view.OrientationEventListener.ORIENTATION_UNKNOWN) return 0;
2394fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *     int sensorOrientation = c.get(CameraCharacteristics.SENSOR_ORIENTATION);
2395fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *
2396fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *     // Round device orientation to a multiple of 90
2397fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *     deviceOrientation = (deviceOrientation + 45) / 90 * 90;
2398fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *
2399fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *     // Reverse device orientation for front-facing cameras
2400fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *     boolean facingFront = c.get(CameraCharacteristics.LENS_FACING) == CameraCharacteristics.LENS_FACING_FRONT;
2401fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *     if (facingFront) deviceOrientation = -deviceOrientation;
2402fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *
2403fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *     // Calculate desired JPEG orientation relative to camera orientation to make
2404fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *     // the image upright relative to the device orientation
2405fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *     int jpegOrientation = (sensorOrientation + deviceOrientation + 360) % 360;
2406fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *
2407fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *     return jpegOrientation;
2408fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * }
2409fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </code></pre>
2410fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Units</b>: Degrees in multiples of 90</p>
2411fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
2412fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * 0, 90, 180, 270</p>
24134b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
2414fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *
2415fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * @see CameraCharacteristics#SENSOR_ORIENTATION
24165a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
24176c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
24185a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Integer> JPEG_ORIENTATION =
24195a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Integer>("android.jpeg.orientation", int.class);
24205a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
24215a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
2422ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>Compression quality of the final JPEG
2423b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * image.</p>
2424e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * <p>85-95 is typical usage range.</p>
2425fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
2426fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * 1-100; larger is higher quality</p>
24274b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
24285a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
24296c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
24305a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Byte> JPEG_QUALITY =
24315a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Byte>("android.jpeg.quality", byte.class);
24325a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
24335a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
2434ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>Compression quality of JPEG
2435e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * thumbnail.</p>
2436fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
2437fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * 1-100; larger is higher quality</p>
24384b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
24395a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
24406c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
24415a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Byte> JPEG_THUMBNAIL_QUALITY =
24425a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Byte>("android.jpeg.thumbnailQuality", byte.class);
24435a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
24445a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
2445b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <p>Resolution of embedded JPEG thumbnail.</p>
24465f2a47f3dedfc7859457067d8cdcdbfc28ee08acZhijun He     * <p>When set to (0, 0) value, the JPEG EXIF will not contain thumbnail,
24475f2a47f3dedfc7859457067d8cdcdbfc28ee08acZhijun He     * but the captured JPEG will still be a valid image.</p>
2448fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>For best results, when issuing a request for a JPEG image, the thumbnail size selected
2449fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * should have the same aspect ratio as the main JPEG output.</p>
245050f7243ca068c793c8b5aca37a9e983b630c477fZhijun He     * <p>If the thumbnail image aspect ratio differs from the JPEG primary image aspect
245150f7243ca068c793c8b5aca37a9e983b630c477fZhijun He     * ratio, the camera device creates the thumbnail by cropping it from the primary image.
245250f7243ca068c793c8b5aca37a9e983b630c477fZhijun He     * For example, if the primary image has 4:3 aspect ratio, the thumbnail image has
245350f7243ca068c793c8b5aca37a9e983b630c477fZhijun He     * 16:9 aspect ratio, the primary image will be cropped vertically (letterbox) to
245450f7243ca068c793c8b5aca37a9e983b630c477fZhijun He     * generate the thumbnail image. The thumbnail image will always have a smaller Field
245550f7243ca068c793c8b5aca37a9e983b630c477fZhijun He     * Of View (FOV) than the primary image when aspect ratios differ.</p>
24565988311cbbde38e09e3cc743e6a398034968ed55Yin-Chia Yeh     * <p>When an {@link CaptureRequest#JPEG_ORIENTATION android.jpeg.orientation} of non-zero degree is requested,
24575988311cbbde38e09e3cc743e6a398034968ed55Yin-Chia Yeh     * the camera device will handle thumbnail rotation in one of the following ways:</p>
24585988311cbbde38e09e3cc743e6a398034968ed55Yin-Chia Yeh     * <ul>
24595988311cbbde38e09e3cc743e6a398034968ed55Yin-Chia Yeh     * <li>Set the {@link android.media.ExifInterface#TAG_ORIENTATION EXIF orientation flag}
24605988311cbbde38e09e3cc743e6a398034968ed55Yin-Chia Yeh     *   and keep jpeg and thumbnail image data unrotated.</li>
24615988311cbbde38e09e3cc743e6a398034968ed55Yin-Chia Yeh     * <li>Rotate the jpeg and thumbnail image data and not set
24625988311cbbde38e09e3cc743e6a398034968ed55Yin-Chia Yeh     *   {@link android.media.ExifInterface#TAG_ORIENTATION EXIF orientation flag}. In this
24635988311cbbde38e09e3cc743e6a398034968ed55Yin-Chia Yeh     *   case, LIMITED or FULL hardware level devices will report rotated thumnail size in
24645988311cbbde38e09e3cc743e6a398034968ed55Yin-Chia Yeh     *   capture result, so the width and height will be interchanged if 90 or 270 degree
24655988311cbbde38e09e3cc743e6a398034968ed55Yin-Chia Yeh     *   orientation is requested. LEGACY device will always report unrotated thumbnail
24665988311cbbde38e09e3cc743e6a398034968ed55Yin-Chia Yeh     *   size.</li>
24675988311cbbde38e09e3cc743e6a398034968ed55Yin-Chia Yeh     * </ul>
2468fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
2469fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES android.jpeg.availableThumbnailSizes}</p>
24704b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
2471fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *
2472fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * @see CameraCharacteristics#JPEG_AVAILABLE_THUMBNAIL_SIZES
24735988311cbbde38e09e3cc743e6a398034968ed55Yin-Chia Yeh     * @see CaptureRequest#JPEG_ORIENTATION
24745a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
24756c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
247672f9f0a96e4476ef231d5001cb30521ad4ce5b1eIgor Murashkin    public static final Key<android.util.Size> JPEG_THUMBNAIL_SIZE =
247772f9f0a96e4476ef231d5001cb30521ad4ce5b1eIgor Murashkin            new Key<android.util.Size>("android.jpeg.thumbnailSize", android.util.Size.class);
24785a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
24795a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
2480fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>The desired lens aperture size, as a ratio of lens focal length to the
2481fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * effective aperture diameter.</p>
2482fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Setting this value is only supported on the camera devices that have a variable
2483fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * aperture lens.</p>
2484fb46c644ceffdd476268c35c7992c4e445bde0a5Zhijun He     * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF,
2485fb46c644ceffdd476268c35c7992c4e445bde0a5Zhijun He     * this can be set along with {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
2486d8fd67931e17c66e530de5482b63863e6c4301aaEino-Ville Talvala     * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}
2487fb46c644ceffdd476268c35c7992c4e445bde0a5Zhijun He     * to achieve manual exposure control.</p>
2488fb46c644ceffdd476268c35c7992c4e445bde0a5Zhijun He     * <p>The requested aperture value may take several frames to reach the
2489fb46c644ceffdd476268c35c7992c4e445bde0a5Zhijun He     * requested value; the camera device will report the current (intermediate)
2490ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * aperture size in capture result metadata while the aperture is changing.
2491ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * While the aperture is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
2492fb46c644ceffdd476268c35c7992c4e445bde0a5Zhijun He     * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of
2493fb46c644ceffdd476268c35c7992c4e445bde0a5Zhijun He     * the ON modes, this will be overridden by the camera device
2494fb46c644ceffdd476268c35c7992c4e445bde0a5Zhijun He     * auto-exposure algorithm, the overridden values are then provided
2495fb46c644ceffdd476268c35c7992c4e445bde0a5Zhijun He     * back to the user in the corresponding result.</p>
2496fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Units</b>: The f-number (f/N)</p>
2497fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
2498fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}</p>
24994b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
25004b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Full capability</b> -
25014b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
25024b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2503fb46c644ceffdd476268c35c7992c4e445bde0a5Zhijun He     *
2504399f05d1e7182ef6c88d30d3b98a467b845ca7c4Zhijun He     * @see CaptureRequest#CONTROL_AE_MODE
25054b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2506265b34ce331cbe296f82ca357645312718c8d4c7Eino-Ville Talvala     * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
2507ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * @see CaptureResult#LENS_STATE
2508265b34ce331cbe296f82ca357645312718c8d4c7Eino-Ville Talvala     * @see CaptureRequest#SENSOR_EXPOSURE_TIME
2509d8fd67931e17c66e530de5482b63863e6c4301aaEino-Ville Talvala     * @see CaptureRequest#SENSOR_FRAME_DURATION
2510265b34ce331cbe296f82ca357645312718c8d4c7Eino-Ville Talvala     * @see CaptureRequest#SENSOR_SENSITIVITY
25115a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
25126c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
25135a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Float> LENS_APERTURE =
25145a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Float>("android.lens.aperture", float.class);
25155a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
25165a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
2517fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>The desired setting for the lens neutral density filter(s).</p>
2518fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>This control will not be supported on most camera devices.</p>
2519855bae407d61b5cc6629248e7692927b4dacd92fRuben Brunk     * <p>Lens filters are typically used to lower the amount of light the
2520855bae407d61b5cc6629248e7692927b4dacd92fRuben Brunk     * sensor is exposed to (measured in steps of EV). As used here, an EV
2521855bae407d61b5cc6629248e7692927b4dacd92fRuben Brunk     * step is the standard logarithmic representation, which are
2522855bae407d61b5cc6629248e7692927b4dacd92fRuben Brunk     * non-negative, and inversely proportional to the amount of light
2523855bae407d61b5cc6629248e7692927b4dacd92fRuben Brunk     * hitting the sensor.  For example, setting this to 0 would result
2524855bae407d61b5cc6629248e7692927b4dacd92fRuben Brunk     * in no reduction of the incoming light, and setting this to 2 would
2525855bae407d61b5cc6629248e7692927b4dacd92fRuben Brunk     * mean that the filter is set to reduce incoming light by two stops
2526855bae407d61b5cc6629248e7692927b4dacd92fRuben Brunk     * (allowing 1/4 of the prior amount of light to the sensor).</p>
2527ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * <p>It may take several frames before the lens filter density changes
2528ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * to the requested value. While the filter density is still changing,
2529ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p>
2530fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Units</b>: Exposure Value (EV)</p>
2531fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
2532fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities}</p>
25334b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
25344b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Full capability</b> -
25354b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
25364b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2537855bae407d61b5cc6629248e7692927b4dacd92fRuben Brunk     *
25384b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2539855bae407d61b5cc6629248e7692927b4dacd92fRuben Brunk     * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
2540ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * @see CaptureResult#LENS_STATE
25415a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
25426c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
25435a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Float> LENS_FILTER_DENSITY =
25445a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Float>("android.lens.filterDensity", float.class);
25455a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
25465a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
2547fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>The desired lens focal length; used for optical zoom.</p>
2548a20f4c2648d7c597e3178978d17eb5894ef2b2b9Ruben Brunk     * <p>This setting controls the physical focal length of the camera
2549a20f4c2648d7c597e3178978d17eb5894ef2b2b9Ruben Brunk     * device's lens. Changing the focal length changes the field of
2550a20f4c2648d7c597e3178978d17eb5894ef2b2b9Ruben Brunk     * view of the camera device, and is usually used for optical zoom.</p>
2551a20f4c2648d7c597e3178978d17eb5894ef2b2b9Ruben Brunk     * <p>Like {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, this
2552a20f4c2648d7c597e3178978d17eb5894ef2b2b9Ruben Brunk     * setting won't be applied instantaneously, and it may take several
2553ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * frames before the lens can change to the requested focal length.
2554a20f4c2648d7c597e3178978d17eb5894ef2b2b9Ruben Brunk     * While the focal length is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will
2555a20f4c2648d7c597e3178978d17eb5894ef2b2b9Ruben Brunk     * be set to MOVING.</p>
2556fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Optical zoom will not be supported on most devices.</p>
2557fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Units</b>: Millimeters</p>
2558fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
2559fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths}</p>
25604b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
2561a20f4c2648d7c597e3178978d17eb5894ef2b2b9Ruben Brunk     *
2562a20f4c2648d7c597e3178978d17eb5894ef2b2b9Ruben Brunk     * @see CaptureRequest#LENS_APERTURE
2563a20f4c2648d7c597e3178978d17eb5894ef2b2b9Ruben Brunk     * @see CaptureRequest#LENS_FOCUS_DISTANCE
2564fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS
2565a20f4c2648d7c597e3178978d17eb5894ef2b2b9Ruben Brunk     * @see CaptureResult#LENS_STATE
25665a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
25676c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
25685a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Float> LENS_FOCAL_LENGTH =
25695a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Float>("android.lens.focalLength", float.class);
25705a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
25715a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
2572fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Desired distance to plane of sharpest focus,
2573b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * measured from frontmost surface of the lens.</p>
2574ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>Should be zero for fixed-focus cameras</p>
2575fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p>
2576fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
2577fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * &gt;= 0</p>
25784b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
25794b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Full capability</b> -
25804b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
25814b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
25824b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     *
25834b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2584fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
25855a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
25866c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
25875a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Float> LENS_FOCUS_DISTANCE =
25885a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Float>("android.lens.focusDistance", float.class);
25895a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
25905a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
2591ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>The range of scene distances that are in
2592b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * sharp focus (depth of field).</p>
2593ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>If variable focus not supported, can still report
2594ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * fixed depth of field range</p>
2595fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Units</b>: A pair of focus distances in diopters: (near,
2596fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * far); see {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details.</p>
2597fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
2598fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * &gt;=0</p>
25994b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
26004b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Limited capability</b> -
26014b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
26024b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
26034b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     *
26044b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2605fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
26065a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
26076c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
26085743868e15c88d2886915163652a1571a218bf39Igor Murashkin    public static final Key<android.util.Pair<Float,Float>> LENS_FOCUS_RANGE =
26095743868e15c88d2886915163652a1571a218bf39Igor Murashkin            new Key<android.util.Pair<Float,Float>>("android.lens.focusRange", new TypeReference<android.util.Pair<Float,Float>>() {{ }});
26105a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
26115a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
261200849b3a430ce164af2db94eeacfd46131de4be8Ruben Brunk     * <p>Sets whether the camera device uses optical image stabilization (OIS)
261300849b3a430ce164af2db94eeacfd46131de4be8Ruben Brunk     * when capturing images.</p>
2614e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * <p>OIS is used to compensate for motion blur due to small
2615e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * movements of the camera during capture. Unlike digital image
2616e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * stabilization ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), OIS
2617e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * makes use of mechanical elements to stabilize the camera
2618e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * sensor, and thus allows for longer exposure times before
2619e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * camera shake becomes apparent.</p>
262045fa43a1815e2d0a25ed3a126e4e732a03b7ed7fZhijun He     * <p>Switching between different optical stabilization modes may take several
262145fa43a1815e2d0a25ed3a126e4e732a03b7ed7fZhijun He     * frames to initialize, the camera device will report the current mode in
262245fa43a1815e2d0a25ed3a126e4e732a03b7ed7fZhijun He     * capture result metadata. For example, When "ON" mode is requested, the
262345fa43a1815e2d0a25ed3a126e4e732a03b7ed7fZhijun He     * optical stabilization modes in the first several capture results may still
262445fa43a1815e2d0a25ed3a126e4e732a03b7ed7fZhijun He     * be "OFF", and it will become "ON" when the initialization is done.</p>
2625fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>If a camera device supports both OIS and digital image stabilization
2626fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), turning both modes on may produce undesirable
2627fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * interaction, so it is recommended not to enable both at the same time.</p>
2628e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * <p>Not all devices will support OIS; see
2629e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization} for
2630e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * available controls.</p>
2631fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
2632fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
2633fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_OFF OFF}</li>
2634fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #LENS_OPTICAL_STABILIZATION_MODE_ON ON}</li>
2635fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
2636fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Available values for this device:</b><br>
2637fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization}</p>
26384b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
26394b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Limited capability</b> -
26404b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
26414b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2642e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     *
2643e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
26444b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2645e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION
26465a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF
26475a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #LENS_OPTICAL_STABILIZATION_MODE_ON
26485a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
26496c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
26505a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE =
26515a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Integer>("android.lens.opticalStabilizationMode", int.class);
26525a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
26535a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
2654ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * <p>Current lens status.</p>
2655ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * <p>For lens parameters {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}, {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance},
2656ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, when changes are requested,
2657ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * they may take several frames to reach the requested values. This state indicates
2658ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * the current status of the lens parameters.</p>
2659ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * <p>When the state is STATIONARY, the lens parameters are not changing. This could be
2660ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * either because the parameters are all fixed, or because the lens has had enough
2661ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * time to reach the most recently-requested values.
2662ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * If all these lens parameters are not changable for a camera device, as listed below:</p>
2663ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * <ul>
2664ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * <li>Fixed focus (<code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} == 0</code>), which means
2665ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} parameter will always be 0.</li>
2666ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * <li>Fixed focal length ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS android.lens.info.availableFocalLengths} contains single value),
2667ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * which means the optical zoom is not supported.</li>
2668ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * <li>No ND filter ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities} contains only 0).</li>
2669ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * <li>Fixed aperture ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures} contains single value).</li>
2670ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * </ul>
2671ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * <p>Then this state will always be STATIONARY.</p>
2672ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * <p>When the state is MOVING, it indicates that at least one of the lens parameters
2673ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * is changing.</p>
2674fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
2675fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
2676fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #LENS_STATE_STATIONARY STATIONARY}</li>
2677fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #LENS_STATE_MOVING MOVING}</li>
2678fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
26794b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
26804b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Limited capability</b> -
26814b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
26824b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2683ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     *
26844b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2685ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * @see CaptureRequest#LENS_APERTURE
2686ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * @see CaptureRequest#LENS_FILTER_DENSITY
2687ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * @see CaptureRequest#LENS_FOCAL_LENGTH
2688ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * @see CaptureRequest#LENS_FOCUS_DISTANCE
2689ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES
2690ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES
2691ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FOCAL_LENGTHS
2692ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0Zhijun He     * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
26935a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #LENS_STATE_STATIONARY
26949ea4ae67fb10a10c464db8372b58bfe574cac03dIgor Murashkin     * @see #LENS_STATE_MOVING
26955a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
26966c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
26975a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Integer> LENS_STATE =
26985a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Integer>("android.lens.state", int.class);
26995a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
27005a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
2701046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * <p>The orientation of the camera relative to the sensor
2702046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * coordinate system.</p>
2703abf0b8b0a8515d8a8a3eaebf471eed7b40bcedfaEino-Ville Talvala     * <p>The four coefficients that describe the quaternion
2704046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * rotation from the Android sensor coordinate system to a
2705046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * camera-aligned coordinate system where the X-axis is
2706046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * aligned with the long side of the image sensor, the Y-axis
2707046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * is aligned with the short side of the image sensor, and
2708046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * the Z-axis is aligned with the optical axis of the sensor.</p>
2709abf0b8b0a8515d8a8a3eaebf471eed7b40bcedfaEino-Ville Talvala     * <p>To convert from the quaternion coefficients <code>(x,y,z,w)</code>
2710046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * to the axis of rotation <code>(a_x, a_y, a_z)</code> and rotation
2711046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * amount <code>theta</code>, the following formulas can be used:</p>
2712046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * <pre><code> theta = 2 * acos(w)
2713046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * a_x = x / sin(theta/2)
2714046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * a_y = y / sin(theta/2)
2715046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * a_z = z / sin(theta/2)
2716046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * </code></pre>
2717046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * <p>To create a 3x3 rotation matrix that applies the rotation
2718abf0b8b0a8515d8a8a3eaebf471eed7b40bcedfaEino-Ville Talvala     * defined by this quaternion, the following matrix can be
2719046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * used:</p>
2720046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * <pre><code>R = [ 1 - 2y^2 - 2z^2,       2xy - 2zw,       2xz + 2yw,
2721046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     *            2xy + 2zw, 1 - 2x^2 - 2z^2,       2yz - 2xw,
2722046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     *            2xz - 2yw,       2yz + 2xw, 1 - 2x^2 - 2y^2 ]
2723046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * </code></pre>
2724046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * <p>This matrix can then be used to apply the rotation to a
2725046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     *  column vector point with</p>
2726046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * <p><code>p' = Rp</code></p>
2727046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * <p>where <code>p</code> is in the device sensor coordinate system, and
2728046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     *  <code>p'</code> is in the camera-oriented coordinate system.</p>
2729046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * <p><b>Units</b>:
2730abf0b8b0a8515d8a8a3eaebf471eed7b40bcedfaEino-Ville Talvala     * Quaternion coefficients</p>
2731046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2732046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     */
2733046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala    @PublicKey
2734046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala    public static final Key<float[]> LENS_POSE_ROTATION =
2735046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala            new Key<float[]>("android.lens.poseRotation", float[].class);
2736046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala
2737046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala    /**
2738046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * <p>Position of the camera optical center.</p>
2739d3dbfb3f75cb1a6351e79d137c7ccfce498672cfEino-Ville Talvala     * <p>The position of the camera device's lens optical center,
2740d3dbfb3f75cb1a6351e79d137c7ccfce498672cfEino-Ville Talvala     * as a three-dimensional vector <code>(x,y,z)</code>, relative to the
2741d3dbfb3f75cb1a6351e79d137c7ccfce498672cfEino-Ville Talvala     * optical center of the largest camera device facing in the
2742d3dbfb3f75cb1a6351e79d137c7ccfce498672cfEino-Ville Talvala     * same direction as this camera, in the {@link android.hardware.SensorEvent Android sensor coordinate
2743d3dbfb3f75cb1a6351e79d137c7ccfce498672cfEino-Ville Talvala     * axes}. Note that only the axis definitions are shared with
2744d3dbfb3f75cb1a6351e79d137c7ccfce498672cfEino-Ville Talvala     * the sensor coordinate system, but not the origin.</p>
2745d3dbfb3f75cb1a6351e79d137c7ccfce498672cfEino-Ville Talvala     * <p>If this device is the largest or only camera device with a
2746d3dbfb3f75cb1a6351e79d137c7ccfce498672cfEino-Ville Talvala     * given facing, then this position will be <code>(0, 0, 0)</code>; a
2747d3dbfb3f75cb1a6351e79d137c7ccfce498672cfEino-Ville Talvala     * camera device with a lens optical center located 3 cm from
2748d3dbfb3f75cb1a6351e79d137c7ccfce498672cfEino-Ville Talvala     * the main sensor along the +X axis (to the right from the
2749d3dbfb3f75cb1a6351e79d137c7ccfce498672cfEino-Ville Talvala     * user's perspective) will report <code>(0.03, 0, 0)</code>.</p>
2750d3dbfb3f75cb1a6351e79d137c7ccfce498672cfEino-Ville Talvala     * <p>To transform a pixel coordinates between two cameras
2751d3dbfb3f75cb1a6351e79d137c7ccfce498672cfEino-Ville Talvala     * facing the same direction, first the source camera
2752abf0b8b0a8515d8a8a3eaebf471eed7b40bcedfaEino-Ville Talvala     * {@link CameraCharacteristics#LENS_RADIAL_DISTORTION android.lens.radialDistortion} must be corrected for.  Then
2753abf0b8b0a8515d8a8a3eaebf471eed7b40bcedfaEino-Ville Talvala     * the source camera {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} needs
2754d3dbfb3f75cb1a6351e79d137c7ccfce498672cfEino-Ville Talvala     * to be applied, followed by the {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation}
2755d3dbfb3f75cb1a6351e79d137c7ccfce498672cfEino-Ville Talvala     * of the source camera, the translation of the source camera
2756d3dbfb3f75cb1a6351e79d137c7ccfce498672cfEino-Ville Talvala     * relative to the destination camera, the
2757d3dbfb3f75cb1a6351e79d137c7ccfce498672cfEino-Ville Talvala     * {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} of the destination camera, and
2758abf0b8b0a8515d8a8a3eaebf471eed7b40bcedfaEino-Ville Talvala     * finally the inverse of {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration}
2759d3dbfb3f75cb1a6351e79d137c7ccfce498672cfEino-Ville Talvala     * of the destination camera. This obtains a
2760d3dbfb3f75cb1a6351e79d137c7ccfce498672cfEino-Ville Talvala     * radial-distortion-free coordinate in the destination
2761d3dbfb3f75cb1a6351e79d137c7ccfce498672cfEino-Ville Talvala     * camera pixel coordinates.</p>
2762d3dbfb3f75cb1a6351e79d137c7ccfce498672cfEino-Ville Talvala     * <p>To compare this against a real image from the destination
2763d3dbfb3f75cb1a6351e79d137c7ccfce498672cfEino-Ville Talvala     * camera, the destination camera image then needs to be
2764d3dbfb3f75cb1a6351e79d137c7ccfce498672cfEino-Ville Talvala     * corrected for radial distortion before comparison or
2765d3dbfb3f75cb1a6351e79d137c7ccfce498672cfEino-Ville Talvala     * sampling.</p>
2766046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * <p><b>Units</b>: Meters</p>
2767046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2768046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     *
2769abf0b8b0a8515d8a8a3eaebf471eed7b40bcedfaEino-Ville Talvala     * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION
2770046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * @see CameraCharacteristics#LENS_POSE_ROTATION
2771abf0b8b0a8515d8a8a3eaebf471eed7b40bcedfaEino-Ville Talvala     * @see CameraCharacteristics#LENS_RADIAL_DISTORTION
2772046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     */
2773046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala    @PublicKey
2774046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala    public static final Key<float[]> LENS_POSE_TRANSLATION =
2775046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala            new Key<float[]>("android.lens.poseTranslation", float[].class);
2776046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala
2777046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala    /**
2778046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * <p>The parameters for this camera device's intrinsic
2779046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * calibration.</p>
2780046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * <p>The five calibration parameters that describe the
2781046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * transform from camera-centric 3D coordinates to sensor
2782046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * pixel coordinates:</p>
2783046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * <pre><code>[f_x, f_y, c_x, c_y, s]
2784046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * </code></pre>
2785046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * <p>Where <code>f_x</code> and <code>f_y</code> are the horizontal and vertical
2786046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * focal lengths, <code>[c_x, c_y]</code> is the position of the optical
2787046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * axis, and <code>s</code> is a skew parameter for the sensor plane not
2788046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * being aligned with the lens plane.</p>
2789046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * <p>These are typically used within a transformation matrix K:</p>
2790046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * <pre><code>K = [ f_x,   s, c_x,
2791046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     *        0, f_y, c_y,
2792046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     *        0    0,   1 ]
2793046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * </code></pre>
2794046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * <p>which can then be combined with the camera pose rotation
2795046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * <code>R</code> and translation <code>t</code> ({@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} and
2796046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation}, respective) to calculate the
2797046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * complete transform from world coordinates to pixel
2798046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * coordinates:</p>
2799046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * <pre><code>P = [ K 0   * [ R t
2800046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     *      0 1 ]     0 1 ]
2801046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * </code></pre>
2802046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * <p>and with <code>p_w</code> being a point in the world coordinate system
2803046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * and <code>p_s</code> being a point in the camera active pixel array
2804046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * coordinate system, and with the mapping including the
2805046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * homogeneous division by z:</p>
2806046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * <pre><code> p_h = (x_h, y_h, z_h) = P p_w
2807046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * p_s = p_h / z_h
2808046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * </code></pre>
2809046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * <p>so <code>[x_s, y_s]</code> is the pixel coordinates of the world
2810046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * point, <code>z_s = 1</code>, and <code>w_s</code> is a measurement of disparity
2811046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * (depth) in pixel coordinates.</p>
2812b8bd8ab184e1f1477945cd3abf5853b29ff8524eEino-Ville Talvala     * <p>Note that the coordinate system for this transform is the
2813b8bd8ab184e1f1477945cd3abf5853b29ff8524eEino-Ville Talvala     * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} system,
2814b8bd8ab184e1f1477945cd3abf5853b29ff8524eEino-Ville Talvala     * where <code>(0,0)</code> is the top-left of the
2815b8bd8ab184e1f1477945cd3abf5853b29ff8524eEino-Ville Talvala     * preCorrectionActiveArraySize rectangle. Once the pose and
2816b8bd8ab184e1f1477945cd3abf5853b29ff8524eEino-Ville Talvala     * intrinsic calibration transforms have been applied to a
2817abf0b8b0a8515d8a8a3eaebf471eed7b40bcedfaEino-Ville Talvala     * world point, then the {@link CameraCharacteristics#LENS_RADIAL_DISTORTION android.lens.radialDistortion}
2818b8bd8ab184e1f1477945cd3abf5853b29ff8524eEino-Ville Talvala     * transform needs to be applied, and the result adjusted to
2819b8bd8ab184e1f1477945cd3abf5853b29ff8524eEino-Ville Talvala     * be in the {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} coordinate
2820b8bd8ab184e1f1477945cd3abf5853b29ff8524eEino-Ville Talvala     * system (where <code>(0, 0)</code> is the top-left of the
2821b8bd8ab184e1f1477945cd3abf5853b29ff8524eEino-Ville Talvala     * activeArraySize rectangle), to determine the final pixel
2822b8bd8ab184e1f1477945cd3abf5853b29ff8524eEino-Ville Talvala     * coordinate of the world point for processed (non-RAW)
2823b8bd8ab184e1f1477945cd3abf5853b29ff8524eEino-Ville Talvala     * output buffers.</p>
2824046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * <p><b>Units</b>:
2825b8bd8ab184e1f1477945cd3abf5853b29ff8524eEino-Ville Talvala     * Pixels in the
2826b8bd8ab184e1f1477945cd3abf5853b29ff8524eEino-Ville Talvala     * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}
2827b8bd8ab184e1f1477945cd3abf5853b29ff8524eEino-Ville Talvala     * coordinate system.</p>
2828046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2829046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     *
2830046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * @see CameraCharacteristics#LENS_POSE_ROTATION
2831046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * @see CameraCharacteristics#LENS_POSE_TRANSLATION
2832abf0b8b0a8515d8a8a3eaebf471eed7b40bcedfaEino-Ville Talvala     * @see CameraCharacteristics#LENS_RADIAL_DISTORTION
28330b7b03b35f3b29a068580be0ab0f68ca11d00bdbEino-Ville Talvala     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2834b8bd8ab184e1f1477945cd3abf5853b29ff8524eEino-Ville Talvala     * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
2835046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     */
2836046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala    @PublicKey
2837046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala    public static final Key<float[]> LENS_INTRINSIC_CALIBRATION =
2838046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala            new Key<float[]>("android.lens.intrinsicCalibration", float[].class);
2839046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala
2840046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala    /**
2841046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * <p>The correction coefficients to correct for this camera device's
284266c73ba846df91a2d0cc25650b17d50f80d0e785Eino-Ville Talvala     * radial and tangential lens distortion.</p>
284302cd8cbc9df749f9dbf5f4bcb2159c07a63b5a2fRuben Brunk     * <p>Four radial distortion coefficients <code>[kappa_0, kappa_1, kappa_2,
284466c73ba846df91a2d0cc25650b17d50f80d0e785Eino-Ville Talvala     * kappa_3]</code> and two tangential distortion coefficients
284566c73ba846df91a2d0cc25650b17d50f80d0e785Eino-Ville Talvala     * <code>[kappa_4, kappa_5]</code> that can be used to correct the
284666c73ba846df91a2d0cc25650b17d50f80d0e785Eino-Ville Talvala     * lens's geometric distortion with the mapping equations:</p>
284702cd8cbc9df749f9dbf5f4bcb2159c07a63b5a2fRuben Brunk     * <pre><code> x_c = x_i * ( kappa_0 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) +
284866c73ba846df91a2d0cc25650b17d50f80d0e785Eino-Ville Talvala     *        kappa_4 * (2 * x_i * y_i) + kappa_5 * ( r^2 + 2 * x_i^2 )
284902cd8cbc9df749f9dbf5f4bcb2159c07a63b5a2fRuben Brunk     *  y_c = y_i * ( kappa_0 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) +
285066c73ba846df91a2d0cc25650b17d50f80d0e785Eino-Ville Talvala     *        kappa_5 * (2 * x_i * y_i) + kappa_4 * ( r^2 + 2 * y_i^2 )
2851046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * </code></pre>
285266c73ba846df91a2d0cc25650b17d50f80d0e785Eino-Ville Talvala     * <p>Here, <code>[x_c, y_c]</code> are the coordinates to sample in the
285366c73ba846df91a2d0cc25650b17d50f80d0e785Eino-Ville Talvala     * input image that correspond to the pixel values in the
285466c73ba846df91a2d0cc25650b17d50f80d0e785Eino-Ville Talvala     * corrected image at the coordinate <code>[x_i, y_i]</code>:</p>
285566c73ba846df91a2d0cc25650b17d50f80d0e785Eino-Ville Talvala     * <pre><code> correctedImage(x_i, y_i) = sample_at(x_c, y_c, inputImage)
285666c73ba846df91a2d0cc25650b17d50f80d0e785Eino-Ville Talvala     * </code></pre>
285766c73ba846df91a2d0cc25650b17d50f80d0e785Eino-Ville Talvala     * <p>The pixel coordinates are defined in a normalized
285866c73ba846df91a2d0cc25650b17d50f80d0e785Eino-Ville Talvala     * coordinate system related to the
2859abf0b8b0a8515d8a8a3eaebf471eed7b40bcedfaEino-Ville Talvala     * {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} calibration fields.
286066c73ba846df91a2d0cc25650b17d50f80d0e785Eino-Ville Talvala     * Both <code>[x_i, y_i]</code> and <code>[x_c, y_c]</code> have <code>(0,0)</code> at the
286166c73ba846df91a2d0cc25650b17d50f80d0e785Eino-Ville Talvala     * lens optical center <code>[c_x, c_y]</code>. The maximum magnitudes
286266c73ba846df91a2d0cc25650b17d50f80d0e785Eino-Ville Talvala     * of both x and y coordinates are normalized to be 1 at the
286366c73ba846df91a2d0cc25650b17d50f80d0e785Eino-Ville Talvala     * edge further from the optical center, so the range
286466c73ba846df91a2d0cc25650b17d50f80d0e785Eino-Ville Talvala     * for both dimensions is <code>-1 &lt;= x &lt;= 1</code>.</p>
286566c73ba846df91a2d0cc25650b17d50f80d0e785Eino-Ville Talvala     * <p>Finally, <code>r</code> represents the radial distance from the
286666c73ba846df91a2d0cc25650b17d50f80d0e785Eino-Ville Talvala     * optical center, <code>r^2 = x_i^2 + y_i^2</code>, and its magnitude
286766c73ba846df91a2d0cc25650b17d50f80d0e785Eino-Ville Talvala     * is therefore no larger than <code>|r| &lt;= sqrt(2)</code>.</p>
286866c73ba846df91a2d0cc25650b17d50f80d0e785Eino-Ville Talvala     * <p>The distortion model used is the Brown-Conrady model.</p>
2869046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * <p><b>Units</b>:
287066c73ba846df91a2d0cc25650b17d50f80d0e785Eino-Ville Talvala     * Unitless coefficients.</p>
2871046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2872abf0b8b0a8515d8a8a3eaebf471eed7b40bcedfaEino-Ville Talvala     *
2873abf0b8b0a8515d8a8a3eaebf471eed7b40bcedfaEino-Ville Talvala     * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION
2874046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala     */
2875046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala    @PublicKey
2876046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala    public static final Key<float[]> LENS_RADIAL_DISTORTION =
2877046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala            new Key<float[]>("android.lens.radialDistortion", float[].class);
2878046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala
2879046a978f684f57b9d1c1c36bcb52cca34124f021Eino-Ville Talvala    /**
2880e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * <p>Mode of operation for the noise reduction algorithm.</p>
2881fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>The noise reduction algorithm attempts to improve image quality by removing
28820e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * excessive noise added by the capture process, especially in dark conditions.</p>
28830e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * <p>OFF means no noise reduction will be applied by the camera device, for both raw and
28840e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * YUV domain.</p>
28850e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * <p>MINIMAL means that only sensor raw domain basic noise reduction is enabled ,to remove
28860e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * demosaicing or other processing artifacts. For YUV_REPROCESSING, MINIMAL is same as OFF.
28870e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * This mode is optional, may not be support by all devices. The application should check
28880e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes} before using it.</p>
28895f2a47f3dedfc7859457067d8cdcdbfc28ee08acZhijun He     * <p>FAST/HIGH_QUALITY both mean camera device determined noise filtering
28905f2a47f3dedfc7859457067d8cdcdbfc28ee08acZhijun He     * will be applied. HIGH_QUALITY mode indicates that the camera device
28915f2a47f3dedfc7859457067d8cdcdbfc28ee08acZhijun He     * will use the highest-quality noise filtering algorithms,
2892e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * even if it slows down capture rate. FAST means the camera device will not
28939c9167efe229f2d7bad0422c371923d5d1776f52Chien-Yu Chen     * slow down capture rate when applying noise filtering. FAST may be the same as MINIMAL if
28949c9167efe229f2d7bad0422c371923d5d1776f52Chien-Yu Chen     * MINIMAL is listed, or the same as OFF if any noise filtering will slow down capture rate.
28959c9167efe229f2d7bad0422c371923d5d1776f52Chien-Yu Chen     * Every output stream will have a similar amount of enhancement applied.</p>
28960dd17509a953774039c0e73beac4b0546504c774Eino-Ville Talvala     * <p>ZERO_SHUTTER_LAG is meant to be used by applications that maintain a continuous circular
28970dd17509a953774039c0e73beac4b0546504c774Eino-Ville Talvala     * buffer of high-resolution images during preview and reprocess image(s) from that buffer
28980dd17509a953774039c0e73beac4b0546504c774Eino-Ville Talvala     * into a final capture when triggered by the user. In this mode, the camera device applies
28990dd17509a953774039c0e73beac4b0546504c774Eino-Ville Talvala     * noise reduction to low-resolution streams (below maximum recording resolution) to maximize
29000dd17509a953774039c0e73beac4b0546504c774Eino-Ville Talvala     * preview quality, but does not apply noise reduction to high-resolution streams, since
29010dd17509a953774039c0e73beac4b0546504c774Eino-Ville Talvala     * those will be reprocessed later if necessary.</p>
29020e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * <p>For YUV_REPROCESSING, these FAST/HIGH_QUALITY modes both mean that the camera device
29030e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * will apply FAST/HIGH_QUALITY YUV domain noise reduction, respectively. The camera device
29040e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * may adjust the noise reduction parameters for best image quality based on the
29050e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * {@link CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR android.reprocess.effectiveExposureFactor} if it is set.</p>
2906fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
2907fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
2908fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #NOISE_REDUCTION_MODE_OFF OFF}</li>
2909fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #NOISE_REDUCTION_MODE_FAST FAST}</li>
2910fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #NOISE_REDUCTION_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
29110e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     *   <li>{@link #NOISE_REDUCTION_MODE_MINIMAL MINIMAL}</li>
29120dd17509a953774039c0e73beac4b0546504c774Eino-Ville Talvala     *   <li>{@link #NOISE_REDUCTION_MODE_ZERO_SHUTTER_LAG ZERO_SHUTTER_LAG}</li>
2913fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
2914fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Available values for this device:</b><br>
2915fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes}</p>
29164b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
29174b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Full capability</b> -
29184b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
29194b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
29206dc379c7bd34d9707ee2ef819a5a07afc2aa9314Ruben Brunk     *
29214b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
29226dc379c7bd34d9707ee2ef819a5a07afc2aa9314Ruben Brunk     * @see CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES
29230e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR
29245a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #NOISE_REDUCTION_MODE_OFF
29255a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #NOISE_REDUCTION_MODE_FAST
29265a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY
29270e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * @see #NOISE_REDUCTION_MODE_MINIMAL
29280dd17509a953774039c0e73beac4b0546504c774Eino-Ville Talvala     * @see #NOISE_REDUCTION_MODE_ZERO_SHUTTER_LAG
29295a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
29306c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
29315a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Integer> NOISE_REDUCTION_MODE =
29325a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Integer>("android.noiseReduction.mode", int.class);
29335a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
29345a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
2935ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>Whether a result given to the framework is the
29367a31310439b8ac6a9dca9e81dd3366221bbb1057Eino-Ville Talvala     * final one for the capture, or only a partial that contains a
29377a31310439b8ac6a9dca9e81dd3366221bbb1057Eino-Ville Talvala     * subset of the full set of dynamic metadata
2938ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * values.</p>
2939ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>The entries in the result metadata buffers for a
29407a31310439b8ac6a9dca9e81dd3366221bbb1057Eino-Ville Talvala     * single capture may not overlap, except for this entry. The
29417a31310439b8ac6a9dca9e81dd3366221bbb1057Eino-Ville Talvala     * FINAL buffers must retain FIFO ordering relative to the
29427a31310439b8ac6a9dca9e81dd3366221bbb1057Eino-Ville Talvala     * requests that generate them, so the FINAL buffer for frame 3 must
29437a31310439b8ac6a9dca9e81dd3366221bbb1057Eino-Ville Talvala     * always be sent to the framework after the FINAL buffer for frame 2, and
29447a31310439b8ac6a9dca9e81dd3366221bbb1057Eino-Ville Talvala     * before the FINAL buffer for frame 4. PARTIAL buffers may be returned
29457a31310439b8ac6a9dca9e81dd3366221bbb1057Eino-Ville Talvala     * in any order relative to other frames, but all PARTIAL buffers for a given
29467a31310439b8ac6a9dca9e81dd3366221bbb1057Eino-Ville Talvala     * capture must arrive before the FINAL buffer for that capture. This entry may
2947cc28a41b48bc687002a9e1fc436d00ca6f0c3692Zhijun He     * only be used by the camera device if quirks.usePartialResult is set to 1.</p>
2948fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
2949fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * Optional. Default value is FINAL.</p>
29503242f4fb19b77bcd2435cbe710188d012d08b005Igor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
29519c595174ccaaf3d36315c4a100e47ee4369073f6Igor Murashkin     * @deprecated
29527a31310439b8ac6a9dca9e81dd3366221bbb1057Eino-Ville Talvala     * @hide
29537a31310439b8ac6a9dca9e81dd3366221bbb1057Eino-Ville Talvala     */
29549c595174ccaaf3d36315c4a100e47ee4369073f6Igor Murashkin    @Deprecated
29557a31310439b8ac6a9dca9e81dd3366221bbb1057Eino-Ville Talvala    public static final Key<Boolean> QUIRKS_PARTIAL_RESULT =
29567a31310439b8ac6a9dca9e81dd3366221bbb1057Eino-Ville Talvala            new Key<Boolean>("android.quirks.partialResult", boolean.class);
29577a31310439b8ac6a9dca9e81dd3366221bbb1057Eino-Ville Talvala
29587a31310439b8ac6a9dca9e81dd3366221bbb1057Eino-Ville Talvala    /**
2959ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>A frame counter set by the framework. This value monotonically
29606bbf9dc5ae7ebc85991dcfe3e18e837b12d3f333Igor Murashkin     * increases with every new result (that is, each new result has a unique
2961ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * frameCount value).</p>
2962ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>Reset on release()</p>
2963fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Units</b>: count of frames</p>
2964fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
2965fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * &gt; 0</p>
29664b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2967bdf366cc70639b0e16b8f84eebe612a48a8b8b06Igor Murashkin     * @deprecated
2968bdf366cc70639b0e16b8f84eebe612a48a8b8b06Igor Murashkin     * @hide
29695a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
2970bdf366cc70639b0e16b8f84eebe612a48a8b8b06Igor Murashkin    @Deprecated
29715a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Integer> REQUEST_FRAME_COUNT =
29725a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Integer>("android.request.frameCount", int.class);
29735a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
29745a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
2975ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>An application-specified ID for the current
29765a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * request. Must be maintained unchanged in output
2977ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * frame</p>
2978fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Units</b>: arbitrary integer assigned by application</p>
2979fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
2980fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * Any int</p>
29814b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
29825a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @hide
29835a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
29845a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Integer> REQUEST_ID =
29855a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Integer>("android.request.id", int.class);
29865a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
29875a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
2988c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * <p>Specifies the number of pipeline stages the frame went
2989c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * through from when it was exposed to when the final completed result
2990c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * was available to the framework.</p>
2991c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * <p>Depending on what settings are used in the request, and
2992c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * what streams are configured, the data may undergo less processing,
2993c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * and some pipeline stages skipped.</p>
2994c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * <p>See {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} for more details.</p>
2995fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
2996fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * &lt;= {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth}</p>
29974b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
2998c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     *
2999c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
3000c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     */
30016c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
3002c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin    public static final Key<Byte> REQUEST_PIPELINE_DEPTH =
3003c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin            new Key<Byte>("android.request.pipelineDepth", byte.class);
3004c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin
3005c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin    /**
3006fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>The desired region of the sensor to read out for this capture.</p>
3007fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>This control can be used to implement digital zoom.</p>
3008b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <p>The crop region coordinate system is based off
3009b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being the
3010b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * top-left corner of the sensor active array.</p>
3011b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <p>Output streams use this rectangle to produce their output,
3012b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * cropping to a smaller region if necessary to maintain the
3013b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * stream's aspect ratio, then scaling the sensor input to
3014b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * match the output's configured resolution.</p>
3015b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <p>The crop region is applied after the RAW to other color
3016b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * space (e.g. YUV) conversion. Since raw streams
3017b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * (e.g. RAW16) don't have the conversion stage, they are not
3018b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * croppable. The crop region will be ignored by raw streams.</p>
30199e6d1880c288d7d0ddcb651dda88d069f058ecedZhijun He     * <p>For non-raw streams, any additional per-stream cropping will
30209e6d1880c288d7d0ddcb651dda88d069f058ecedZhijun He     * be done to maximize the final pixel area of the stream.</p>
3021ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>For example, if the crop region is set to a 4:3 aspect
3022b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * ratio, then 4:3 streams will use the exact crop
3023b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * region. 16:9 streams will further crop vertically
3024ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * (letterbox).</p>
3025ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>Conversely, if the crop region is set to a 16:9, then 4:3
3026b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * outputs will crop horizontally (pillarbox), and 16:9
3027b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * streams will match exactly. These additional crops will
3028ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * be centered within the crop region.</p>
3029b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <p>The width and height of the crop region cannot
3030b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * be set to be smaller than
3031b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <code>floor( activeArraySize.width / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code> and
3032b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <code>floor( activeArraySize.height / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code>, respectively.</p>
3033b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <p>The camera device may adjust the crop region to account
3034b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * for rounding and other hardware requirements; the final
3035b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * crop region used will be included in the output capture
3036b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * result.</p>
3037fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Units</b>: Pixel coordinates relative to
3038fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</p>
30394b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
3040d8fd67931e17c66e530de5482b63863e6c4301aaEino-Ville Talvala     *
3041d8fd67931e17c66e530de5482b63863e6c4301aaEino-Ville Talvala     * @see CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM
3042b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
30435a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
30446c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
30455a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<android.graphics.Rect> SCALER_CROP_REGION =
30465a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class);
30475a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
30485a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
3049ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>Duration each pixel is exposed to
3050ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * light.</p>
3051fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>If the sensor can't expose this exact duration, it will shorten the
3052fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * duration exposed to the nearest possible value (rather than expose longer).
3053fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * The final exposure time used will be available in the output capture result.</p>
3054fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-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
3055fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * OFF; otherwise the auto-exposure algorithm will override this value.</p>
3056fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Units</b>: Nanoseconds</p>
3057fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
3058fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE android.sensor.info.exposureTimeRange}</p>
30594b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
30604b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Full capability</b> -
30614b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
30624b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
30634b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     *
3064fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * @see CaptureRequest#CONTROL_AE_MODE
3065fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * @see CaptureRequest#CONTROL_MODE
30664b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3067fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * @see CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE
30685a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
30696c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
30705a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Long> SENSOR_EXPOSURE_TIME =
30715a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Long>("android.sensor.exposureTime", long.class);
30725a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
30735a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
3074ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>Duration from start of frame exposure to
3075143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * start of next frame exposure.</p>
3076143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * <p>The maximum frame rate that can be supported by a camera subsystem is
3077143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * a function of many factors:</p>
3078143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * <ul>
3079143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * <li>Requested resolutions of output image streams</li>
3080143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * <li>Availability of binning / skipping modes on the imager</li>
3081143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * <li>The bandwidth of the imager interface</li>
3082143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * <li>The bandwidth of the various ISP processing blocks</li>
3083143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * </ul>
3084143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * <p>Since these factors can vary greatly between different ISPs and
3085143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * sensors, the camera abstraction tries to represent the bandwidth
3086143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * restrictions with as simple a model as possible.</p>
3087143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * <p>The model presented has the following characteristics:</p>
3088143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * <ul>
3089143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * <li>The image sensor is always configured to output the smallest
3090143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * resolution possible given the application's requested output stream
3091143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * sizes.  The smallest resolution is defined as being at least as large
3092143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * as the largest requested output stream size; the camera pipeline must
3093143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * never digitally upsample sensor data when the crop region covers the
3094143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * whole sensor. In general, this means that if only small output stream
3095143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * resolutions are configured, the sensor can provide a higher frame
3096143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * rate.</li>
3097143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * <li>Since any request may use any or all the currently configured
3098143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * output streams, the sensor and ISP must be configured to support
3099143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * scaling a single capture to all the streams at the same time.  This
3100143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * means the camera pipeline must be ready to produce the largest
3101143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * requested output size without any delay.  Therefore, the overall
3102143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * frame rate of a given configured stream set is governed only by the
3103143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * largest requested stream resolution.</li>
3104143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * <li>Using more than one output stream in a request does not affect the
3105143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * frame duration.</li>
3106a23ffb5f50d5bf72bde9b8fdbcbd0cea037135b3Igor Murashkin     * <li>Certain format-streams may need to do additional background processing
3107a23ffb5f50d5bf72bde9b8fdbcbd0cea037135b3Igor Murashkin     * before data is consumed/produced by that stream. These processors
3108a23ffb5f50d5bf72bde9b8fdbcbd0cea037135b3Igor Murashkin     * can run concurrently to the rest of the camera pipeline, but
3109a23ffb5f50d5bf72bde9b8fdbcbd0cea037135b3Igor Murashkin     * cannot process more than 1 capture at a time.</li>
3110143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * </ul>
3111143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * <p>The necessary information for the application, given the model above,
3112b6eb52ffc51cec78c3adc2e5b25c4c3214344983Eino-Ville Talvala     * is provided via the {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} field using
3113b6eb52ffc51cec78c3adc2e5b25c4c3214344983Eino-Ville Talvala     * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration }.
3114143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * These are used to determine the maximum frame rate / minimum frame
3115143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * duration that is possible for a given stream configuration.</p>
3116143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * <p>Specifically, the application can use the following rules to
3117a23ffb5f50d5bf72bde9b8fdbcbd0cea037135b3Igor Murashkin     * determine the minimum frame duration it can request from the camera
3118143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * device:</p>
3119143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * <ol>
3120a23ffb5f50d5bf72bde9b8fdbcbd0cea037135b3Igor Murashkin     * <li>Let the set of currently configured input/output streams
3121a23ffb5f50d5bf72bde9b8fdbcbd0cea037135b3Igor Murashkin     * be called <code>S</code>.</li>
3122b6eb52ffc51cec78c3adc2e5b25c4c3214344983Eino-Ville Talvala     * <li>Find the minimum frame durations for each stream in <code>S</code>, by looking
3123b6eb52ffc51cec78c3adc2e5b25c4c3214344983Eino-Ville Talvala     * it up in {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} using {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration }
3124b6eb52ffc51cec78c3adc2e5b25c4c3214344983Eino-Ville Talvala     * (with its respective size/format). Let this set of frame durations be
3125b6eb52ffc51cec78c3adc2e5b25c4c3214344983Eino-Ville Talvala     * called <code>F</code>.</li>
3126a23ffb5f50d5bf72bde9b8fdbcbd0cea037135b3Igor Murashkin     * <li>For any given request <code>R</code>, the minimum frame duration allowed
3127a23ffb5f50d5bf72bde9b8fdbcbd0cea037135b3Igor Murashkin     * for <code>R</code> is the maximum out of all values in <code>F</code>. Let the streams
3128a23ffb5f50d5bf72bde9b8fdbcbd0cea037135b3Igor Murashkin     * used in <code>R</code> be called <code>S_r</code>.</li>
3129143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     * </ol>
3130b6eb52ffc51cec78c3adc2e5b25c4c3214344983Eino-Ville Talvala     * <p>If none of the streams in <code>S_r</code> have a stall time (listed in {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration }
3131b6eb52ffc51cec78c3adc2e5b25c4c3214344983Eino-Ville Talvala     * using its respective size/format), then the frame duration in <code>F</code>
3132b6eb52ffc51cec78c3adc2e5b25c4c3214344983Eino-Ville Talvala     * determines the steady state frame rate that the application will get
3133b6eb52ffc51cec78c3adc2e5b25c4c3214344983Eino-Ville Talvala     * if it uses <code>R</code> as a repeating request. Let this special kind of
3134b6eb52ffc51cec78c3adc2e5b25c4c3214344983Eino-Ville Talvala     * request be called <code>Rsimple</code>.</p>
3135a23ffb5f50d5bf72bde9b8fdbcbd0cea037135b3Igor Murashkin     * <p>A repeating request <code>Rsimple</code> can be <em>occasionally</em> interleaved
3136a23ffb5f50d5bf72bde9b8fdbcbd0cea037135b3Igor Murashkin     * by a single capture of a new request <code>Rstall</code> (which has at least
3137a23ffb5f50d5bf72bde9b8fdbcbd0cea037135b3Igor Murashkin     * one in-use stream with a non-0 stall time) and if <code>Rstall</code> has the
3138a23ffb5f50d5bf72bde9b8fdbcbd0cea037135b3Igor Murashkin     * same minimum frame duration this will not cause a frame rate loss
3139a23ffb5f50d5bf72bde9b8fdbcbd0cea037135b3Igor Murashkin     * if all buffers from the previous <code>Rstall</code> have already been
3140a23ffb5f50d5bf72bde9b8fdbcbd0cea037135b3Igor Murashkin     * delivered.</p>
3141a23ffb5f50d5bf72bde9b8fdbcbd0cea037135b3Igor Murashkin     * <p>For more details about stalling, see
3142b6eb52ffc51cec78c3adc2e5b25c4c3214344983Eino-Ville Talvala     * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration }.</p>
3143fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-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
3144fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * OFF; otherwise the auto-exposure algorithm will override this value.</p>
3145fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Units</b>: Nanoseconds</p>
3146fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
3147fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * See {@link CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION android.sensor.info.maxFrameDuration},
3148fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}. The duration
3149fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * is capped to <code>max(duration, exposureTime + overhead)</code>.</p>
31504b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
31514b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Full capability</b> -
31524b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
31534b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3154143aa0b891b2f8bf8ffabf8c53966c3cf97e9eb0Igor Murashkin     *
3155fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * @see CaptureRequest#CONTROL_AE_MODE
3156fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * @see CaptureRequest#CONTROL_MODE
31574b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
31589c595174ccaaf3d36315c4a100e47ee4369073f6Igor Murashkin     * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
3159fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * @see CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION
31605a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
31616c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
31625a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Long> SENSOR_FRAME_DURATION =
31635a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Long>("android.sensor.frameDuration", long.class);
31645a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
31655a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
3166b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <p>The amount of gain applied to sensor data
3167b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * before processing.</p>
3168b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <p>The sensitivity is the standard ISO sensitivity value,
3169b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * as defined in ISO 12232:2006.</p>
3170b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <p>The sensitivity must be within {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}, and
3171b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * if if it less than {@link CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY android.sensor.maxAnalogSensitivity}, the camera device
3172b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * is guaranteed to use only analog amplification for applying the gain.</p>
3173b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <p>If the camera device cannot apply the exact sensitivity
3174b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * requested, it will reduce the gain to the nearest supported
3175b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * value. The final sensitivity used will be available in the
3176b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * output capture result.</p>
31771ee1a0ae60c1e7acd4f334f9a31c67ae4e40f73aYin-Chia Yeh     * <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
31781ee1a0ae60c1e7acd4f334f9a31c67ae4e40f73aYin-Chia Yeh     * OFF; otherwise the auto-exposure algorithm will override this value.</p>
3179fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Units</b>: ISO arithmetic units</p>
3180fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
3181fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}</p>
31824b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
31834b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Full capability</b> -
31844b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
31854b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3186b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     *
31871ee1a0ae60c1e7acd4f334f9a31c67ae4e40f73aYin-Chia Yeh     * @see CaptureRequest#CONTROL_AE_MODE
31881ee1a0ae60c1e7acd4f334f9a31c67ae4e40f73aYin-Chia Yeh     * @see CaptureRequest#CONTROL_MODE
31894b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3190b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * @see CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE
3191b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * @see CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY
31925a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
31936c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
31945a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Integer> SENSOR_SENSITIVITY =
31955a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Integer>("android.sensor.sensitivity", int.class);
31965a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
31975a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
3198ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>Time at start of exposure of first
31990bda31afe06a05144a31ce47adbc54694ec24228Zhijun He     * row of the image sensor active array, in nanoseconds.</p>
3200b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <p>The timestamps are also included in all image
3201b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * buffers produced for the same capture, and will be identical
320245fa43a1815e2d0a25ed3a126e4e732a03b7ed7fZhijun He     * on all the outputs.</p>
3203abd9d3c5c7100c45812ee80975ac59f5b1902a71Eino-Ville Talvala     * <p>When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> UNKNOWN,
320445fa43a1815e2d0a25ed3a126e4e732a03b7ed7fZhijun He     * the timestamps measure time since an unspecified starting point,
320545fa43a1815e2d0a25ed3a126e4e732a03b7ed7fZhijun He     * and are monotonically increasing. They can be compared with the
320645fa43a1815e2d0a25ed3a126e4e732a03b7ed7fZhijun He     * timestamps for other captures from the same camera device, but are
320745fa43a1815e2d0a25ed3a126e4e732a03b7ed7fZhijun He     * not guaranteed to be comparable to any other time source.</p>
3208b6eb52ffc51cec78c3adc2e5b25c4c3214344983Eino-Ville Talvala     * <p>When {@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> REALTIME, the
3209b6eb52ffc51cec78c3adc2e5b25c4c3214344983Eino-Ville Talvala     * timestamps measure time in the same timebase as {@link android.os.SystemClock#elapsedRealtimeNanos }, and they can
3210b6eb52ffc51cec78c3adc2e5b25c4c3214344983Eino-Ville Talvala     * be compared to other timestamps from other subsystems that
3211b6eb52ffc51cec78c3adc2e5b25c4c3214344983Eino-Ville Talvala     * are using that base.</p>
32126216e4e06f00b5b1c1faf739be1fdbe13ad18ca9Chien-Yu Chen     * <p>For reprocessing, the timestamp will match the start of exposure of
32136216e4e06f00b5b1c1faf739be1fdbe13ad18ca9Chien-Yu Chen     * the input image, i.e. {@link CaptureResult#SENSOR_TIMESTAMP the
32146216e4e06f00b5b1c1faf739be1fdbe13ad18ca9Chien-Yu Chen     * timestamp} in the TotalCaptureResult that was used to create the
32156216e4e06f00b5b1c1faf739be1fdbe13ad18ca9Chien-Yu Chen     * reprocess capture request.</p>
3216fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Units</b>: Nanoseconds</p>
3217fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
3218fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * &gt; 0</p>
32194b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
322045fa43a1815e2d0a25ed3a126e4e732a03b7ed7fZhijun He     *
3221abd9d3c5c7100c45812ee80975ac59f5b1902a71Eino-Ville Talvala     * @see CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE
32225a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
32236c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
32245a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Long> SENSOR_TIMESTAMP =
32255a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Long>("android.sensor.timestamp", long.class);
32265a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
32275a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
32287c062369d55ad6f6f0c9c3bd8439c50cbfb88f42Ruben Brunk     * <p>The estimated camera neutral color in the native sensor colorspace at
32297c062369d55ad6f6f0c9c3bd8439c50cbfb88f42Ruben Brunk     * the time of capture.</p>
32307c062369d55ad6f6f0c9c3bd8439c50cbfb88f42Ruben Brunk     * <p>This value gives the neutral color point encoded as an RGB value in the
32317c062369d55ad6f6f0c9c3bd8439c50cbfb88f42Ruben Brunk     * native sensor color space.  The neutral color point indicates the
32327c062369d55ad6f6f0c9c3bd8439c50cbfb88f42Ruben Brunk     * currently estimated white point of the scene illumination.  It can be
32337c062369d55ad6f6f0c9c3bd8439c50cbfb88f42Ruben Brunk     * used to interpolate between the provided color transforms when
32347c062369d55ad6f6f0c9c3bd8439c50cbfb88f42Ruben Brunk     * processing raw sensor data.</p>
32357c062369d55ad6f6f0c9c3bd8439c50cbfb88f42Ruben Brunk     * <p>The order of the values is R, G, B; where R is in the lowest index.</p>
323620c76f67585172684729d701586a4a294d67f0a1Ruben Brunk     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
323720c76f67585172684729d701586a4a294d67f0a1Ruben Brunk     */
32386c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
323920c76f67585172684729d701586a4a294d67f0a1Ruben Brunk    public static final Key<Rational[]> SENSOR_NEUTRAL_COLOR_POINT =
324020c76f67585172684729d701586a4a294d67f0a1Ruben Brunk            new Key<Rational[]>("android.sensor.neutralColorPoint", Rational[].class);
324120c76f67585172684729d701586a4a294d67f0a1Ruben Brunk
324220c76f67585172684729d701586a4a294d67f0a1Ruben Brunk    /**
32431b1f1b611c8e648b9737e7930e6982cf117134ceRuben Brunk     * <p>Noise model coefficients for each CFA mosaic channel.</p>
3244fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>This key contains two noise model coefficients for each CFA channel
32451b1f1b611c8e648b9737e7930e6982cf117134ceRuben Brunk     * corresponding to the sensor amplification (S) and sensor readout
32461b1f1b611c8e648b9737e7930e6982cf117134ceRuben Brunk     * noise (O).  These are given as pairs of coefficients for each channel
3247fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * in the same order as channels listed for the CFA layout key
32481b1f1b611c8e648b9737e7930e6982cf117134ceRuben Brunk     * (see {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT android.sensor.info.colorFilterArrangement}).  This is
32491b1f1b611c8e648b9737e7930e6982cf117134ceRuben Brunk     * represented as an array of Pair&lt;Double, Double&gt;, where
32501b1f1b611c8e648b9737e7930e6982cf117134ceRuben Brunk     * the first member of the Pair at index n is the S coefficient and the
32511b1f1b611c8e648b9737e7930e6982cf117134ceRuben Brunk     * second member is the O coefficient for the nth color channel in the CFA.</p>
32521b1f1b611c8e648b9737e7930e6982cf117134ceRuben Brunk     * <p>These coefficients are used in a two parameter noise model to describe
32531b1f1b611c8e648b9737e7930e6982cf117134ceRuben Brunk     * the amount of noise present in the image for each CFA channel.  The
32541b1f1b611c8e648b9737e7930e6982cf117134ceRuben Brunk     * noise model used here is:</p>
32551b1f1b611c8e648b9737e7930e6982cf117134ceRuben Brunk     * <p>N(x) = sqrt(Sx + O)</p>
32561b1f1b611c8e648b9737e7930e6982cf117134ceRuben Brunk     * <p>Where x represents the recorded signal of a CFA channel normalized to
32571b1f1b611c8e648b9737e7930e6982cf117134ceRuben Brunk     * the range [0, 1], and S and O are the noise model coeffiecients for
32581b1f1b611c8e648b9737e7930e6982cf117134ceRuben Brunk     * that channel.</p>
32591b1f1b611c8e648b9737e7930e6982cf117134ceRuben Brunk     * <p>A more detailed description of the noise model can be found in the
32601b1f1b611c8e648b9737e7930e6982cf117134ceRuben Brunk     * Adobe DNG specification for the NoiseProfile tag.</p>
32611b1f1b611c8e648b9737e7930e6982cf117134ceRuben Brunk     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
32621b1f1b611c8e648b9737e7930e6982cf117134ceRuben Brunk     *
32631b1f1b611c8e648b9737e7930e6982cf117134ceRuben Brunk     * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
32641b1f1b611c8e648b9737e7930e6982cf117134ceRuben Brunk     */
32651b1f1b611c8e648b9737e7930e6982cf117134ceRuben Brunk    @PublicKey
32661b1f1b611c8e648b9737e7930e6982cf117134ceRuben Brunk    public static final Key<android.util.Pair<Double,Double>[]> SENSOR_NOISE_PROFILE =
32671b1f1b611c8e648b9737e7930e6982cf117134ceRuben Brunk            new Key<android.util.Pair<Double,Double>[]>("android.sensor.noiseProfile", new TypeReference<android.util.Pair<Double,Double>[]>() {{ }});
32681b1f1b611c8e648b9737e7930e6982cf117134ceRuben Brunk
32691b1f1b611c8e648b9737e7930e6982cf117134ceRuben Brunk    /**
3270987d9f7a6b077f1f548897a6d658f61bac6860e4Ruben Brunk     * <p>The worst-case divergence between Bayer green channels.</p>
3271987d9f7a6b077f1f548897a6d658f61bac6860e4Ruben Brunk     * <p>This value is an estimate of the worst case split between the
3272987d9f7a6b077f1f548897a6d658f61bac6860e4Ruben Brunk     * Bayer green channels in the red and blue rows in the sensor color
3273987d9f7a6b077f1f548897a6d658f61bac6860e4Ruben Brunk     * filter array.</p>
3274987d9f7a6b077f1f548897a6d658f61bac6860e4Ruben Brunk     * <p>The green split is calculated as follows:</p>
3275987d9f7a6b077f1f548897a6d658f61bac6860e4Ruben Brunk     * <ol>
3276e89b120eae1206dfff9abbb43d0075c23a5672ccRuben Brunk     * <li>A 5x5 pixel (or larger) window W within the active sensor array is
3277e89b120eae1206dfff9abbb43d0075c23a5672ccRuben Brunk     * chosen. The term 'pixel' here is taken to mean a group of 4 Bayer
3278e89b120eae1206dfff9abbb43d0075c23a5672ccRuben Brunk     * mosaic channels (R, Gr, Gb, B).  The location and size of the window
3279e89b120eae1206dfff9abbb43d0075c23a5672ccRuben Brunk     * chosen is implementation defined, and should be chosen to provide a
3280e89b120eae1206dfff9abbb43d0075c23a5672ccRuben Brunk     * green split estimate that is both representative of the entire image
3281e89b120eae1206dfff9abbb43d0075c23a5672ccRuben Brunk     * for this camera sensor, and can be calculated quickly.</li>
3282987d9f7a6b077f1f548897a6d658f61bac6860e4Ruben Brunk     * <li>The arithmetic mean of the green channels from the red
3283987d9f7a6b077f1f548897a6d658f61bac6860e4Ruben Brunk     * rows (mean_Gr) within W is computed.</li>
3284987d9f7a6b077f1f548897a6d658f61bac6860e4Ruben Brunk     * <li>The arithmetic mean of the green channels from the blue
3285987d9f7a6b077f1f548897a6d658f61bac6860e4Ruben Brunk     * rows (mean_Gb) within W is computed.</li>
3286987d9f7a6b077f1f548897a6d658f61bac6860e4Ruben Brunk     * <li>The maximum ratio R of the two means is computed as follows:
3287987d9f7a6b077f1f548897a6d658f61bac6860e4Ruben Brunk     * <code>R = max((mean_Gr + 1)/(mean_Gb + 1), (mean_Gb + 1)/(mean_Gr + 1))</code></li>
3288987d9f7a6b077f1f548897a6d658f61bac6860e4Ruben Brunk     * </ol>
3289987d9f7a6b077f1f548897a6d658f61bac6860e4Ruben Brunk     * <p>The ratio R is the green split divergence reported for this property,
3290987d9f7a6b077f1f548897a6d658f61bac6860e4Ruben Brunk     * which represents how much the green channels differ in the mosaic
3291987d9f7a6b077f1f548897a6d658f61bac6860e4Ruben Brunk     * pattern.  This value is typically used to determine the treatment of
3292987d9f7a6b077f1f548897a6d658f61bac6860e4Ruben Brunk     * the green mosaic channels when demosaicing.</p>
3293987d9f7a6b077f1f548897a6d658f61bac6860e4Ruben Brunk     * <p>The green split value can be roughly interpreted as follows:</p>
3294987d9f7a6b077f1f548897a6d658f61bac6860e4Ruben Brunk     * <ul>
3295987d9f7a6b077f1f548897a6d658f61bac6860e4Ruben Brunk     * <li>R &lt; 1.03 is a negligible split (&lt;3% divergence).</li>
3296987d9f7a6b077f1f548897a6d658f61bac6860e4Ruben Brunk     * <li>1.20 &lt;= R &gt;= 1.03 will require some software
3297987d9f7a6b077f1f548897a6d658f61bac6860e4Ruben Brunk     * correction to avoid demosaic errors (3-20% divergence).</li>
3298987d9f7a6b077f1f548897a6d658f61bac6860e4Ruben Brunk     * <li>R &gt; 1.20 will require strong software correction to produce
3299987d9f7a6b077f1f548897a6d658f61bac6860e4Ruben Brunk     * a usuable image (&gt;20% divergence).</li>
3300987d9f7a6b077f1f548897a6d658f61bac6860e4Ruben Brunk     * </ul>
3301fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br></p>
3302fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>&gt;= 0</p>
3303987d9f7a6b077f1f548897a6d658f61bac6860e4Ruben Brunk     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3304987d9f7a6b077f1f548897a6d658f61bac6860e4Ruben Brunk     */
33056c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
3306987d9f7a6b077f1f548897a6d658f61bac6860e4Ruben Brunk    public static final Key<Float> SENSOR_GREEN_SPLIT =
3307987d9f7a6b077f1f548897a6d658f61bac6860e4Ruben Brunk            new Key<Float>("android.sensor.greenSplit", float.class);
3308987d9f7a6b077f1f548897a6d658f61bac6860e4Ruben Brunk
3309987d9f7a6b077f1f548897a6d658f61bac6860e4Ruben Brunk    /**
3310379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <p>A pixel <code>[R, G_even, G_odd, B]</code> that supplies the test pattern
3311379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * when {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode} is SOLID_COLOR.</p>
3312379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <p>Each color channel is treated as an unsigned 32-bit integer.
3313379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * The camera device then uses the most significant X bits
3314379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * that correspond to how many bits are in its Bayer raw sensor
3315379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * output.</p>
3316379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <p>For example, a sensor with RAW10 Bayer output would use the
3317379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * 10 most significant bits from each color channel.</p>
3318379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3319379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     *
3320379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
3321379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     */
33226c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
3323379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He    public static final Key<int[]> SENSOR_TEST_PATTERN_DATA =
3324379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He            new Key<int[]>("android.sensor.testPatternData", int[].class);
3325379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He
3326379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He    /**
3327c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * <p>When enabled, the sensor sends a test pattern instead of
3328c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * doing a real exposure from the camera.</p>
3329c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * <p>When a test pattern is enabled, all manual sensor controls specified
3330e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * by android.sensor.* will be ignored. All other controls should
3331c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * work as normal.</p>
3332c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * <p>For example, if manual flash is enabled, flash firing should still
3333c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * occur (and that the test pattern remain unmodified, since the flash
3334c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * would not actually affect it).</p>
3335fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Defaults to OFF.</p>
3336fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
3337fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
3338fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #SENSOR_TEST_PATTERN_MODE_OFF OFF}</li>
3339fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR SOLID_COLOR}</li>
3340fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS COLOR_BARS}</li>
3341fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY COLOR_BARS_FADE_TO_GRAY}</li>
3342fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #SENSOR_TEST_PATTERN_MODE_PN9 PN9}</li>
3343fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #SENSOR_TEST_PATTERN_MODE_CUSTOM1 CUSTOM1}</li>
3344fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
3345fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Available values for this device:</b><br>
3346fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES android.sensor.availableTestPatternModes}</p>
3347c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3348fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *
3349fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * @see CameraCharacteristics#SENSOR_AVAILABLE_TEST_PATTERN_MODES
3350c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * @see #SENSOR_TEST_PATTERN_MODE_OFF
3351c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * @see #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR
3352c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS
3353c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY
3354c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * @see #SENSOR_TEST_PATTERN_MODE_PN9
3355c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     * @see #SENSOR_TEST_PATTERN_MODE_CUSTOM1
3356c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin     */
33576c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
3358c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin    public static final Key<Integer> SENSOR_TEST_PATTERN_MODE =
3359c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin            new Key<Integer>("android.sensor.testPatternMode", int.class);
3360c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin
3361c127f05292919ef1646b08b16dca1fe7c324afd4Igor Murashkin    /**
33620bda31afe06a05144a31ce47adbc54694ec24228Zhijun He     * <p>Duration between the start of first row exposure
33630bda31afe06a05144a31ce47adbc54694ec24228Zhijun He     * and the start of last row exposure.</p>
3364fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>This is the exposure time skew between the first and last
3365fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * row exposure start times. The first row and the last row are
3366fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * the first and last rows inside of the
3367fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
33680bda31afe06a05144a31ce47adbc54694ec24228Zhijun He     * <p>For typical camera sensors that use rolling shutters, this is also equivalent
33690bda31afe06a05144a31ce47adbc54694ec24228Zhijun He     * to the frame readout time.</p>
3370fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Units</b>: Nanoseconds</p>
3371fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
3372fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * &gt;= 0 and &lt;
3373b6eb52ffc51cec78c3adc2e5b25c4c3214344983Eino-Ville Talvala     * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration }.</p>
33744b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
33754b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Limited capability</b> -
33764b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
33774b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
33780bda31afe06a05144a31ce47adbc54694ec24228Zhijun He     *
33794b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
33800bda31afe06a05144a31ce47adbc54694ec24228Zhijun He     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
33810bda31afe06a05144a31ce47adbc54694ec24228Zhijun He     */
33826c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
33830bda31afe06a05144a31ce47adbc54694ec24228Zhijun He    public static final Key<Long> SENSOR_ROLLING_SHUTTER_SKEW =
33840bda31afe06a05144a31ce47adbc54694ec24228Zhijun He            new Key<Long>("android.sensor.rollingShutterSkew", long.class);
33850bda31afe06a05144a31ce47adbc54694ec24228Zhijun He
33860bda31afe06a05144a31ce47adbc54694ec24228Zhijun He    /**
3387cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * <p>A per-frame dynamic black level offset for each of the color filter
3388cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * arrangement (CFA) mosaic channels.</p>
3389cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * <p>Camera sensor black levels may vary dramatically for different
3390cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * capture settings (e.g. {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}). The fixed black
3391cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * level reported by {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern} may be too
3392cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * inaccurate to represent the actual value on a per-frame basis. The
3393cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * camera device internal pipeline relies on reliable black level values
3394cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * to process the raw images appropriately. To get the best image
3395cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * quality, the camera device may choose to estimate the per frame black
3396cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * level values either based on optically shielded black regions
3397cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * ({@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions}) or its internal model.</p>
3398cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * <p>This key reports the camera device estimated per-frame zero light
3399cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * value for each of the CFA mosaic channels in the camera sensor. The
3400cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern} may only represent a coarse
3401cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * approximation of the actual black level values. This value is the
3402cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * black level used in camera device internal image processing pipeline
3403cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * and generally more accurate than the fixed black level values.
3404cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * However, since they are estimated values by the camera device, they
3405cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * may not be as accurate as the black level values calculated from the
3406cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * optical black pixels reported by {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions}.</p>
3407cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * <p>The values are given in the same order as channels listed for the CFA
3408cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * layout key (see {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT android.sensor.info.colorFilterArrangement}), i.e. the
3409cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * nth value given corresponds to the black level offset for the nth
3410cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * color channel listed in the CFA.</p>
3411cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * <p>This key will be available if {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions} is
3412cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * available or the camera device advertises this key via
3413a37d265df97ab535e02deaeb29fa648fdd21d4f9Yin-Chia Yeh     * {@link android.hardware.camera2.CameraCharacteristics#getAvailableCaptureResultKeys }.</p>
3414cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * <p><b>Range of valid values:</b><br>
3415cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * &gt;= 0 for each.</p>
3416cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3417cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     *
3418cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * @see CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN
3419cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
3420cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * @see CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS
3421cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * @see CaptureRequest#SENSOR_SENSITIVITY
3422cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     */
3423cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He    @PublicKey
34248998ad9675c9fd99b86f9cda477f8f0d198ae7daZhijun He    public static final Key<float[]> SENSOR_DYNAMIC_BLACK_LEVEL =
34258998ad9675c9fd99b86f9cda477f8f0d198ae7daZhijun He            new Key<float[]>("android.sensor.dynamicBlackLevel", float[].class);
3426cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He
3427cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He    /**
3428cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * <p>Maximum raw value output by sensor for this frame.</p>
3429c7c569d5e42c1d7c17881fd89dcbbbab42dafea1Eino-Ville Talvala     * <p>Since the {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern} may change for different
3430cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * capture settings (e.g., {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}), the white
3431cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * level will change accordingly. This key is similar to
3432cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * {@link CameraCharacteristics#SENSOR_INFO_WHITE_LEVEL android.sensor.info.whiteLevel}, but specifies the camera device
3433cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * estimated white level for each frame.</p>
3434cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * <p>This key will be available if {@link CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS android.sensor.opticalBlackRegions} is
3435cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * available or the camera device advertises this key via
3436cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * {@link android.hardware.camera2.CameraCharacteristics#getAvailableCaptureRequestKeys }.</p>
3437cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * <p><b>Range of valid values:</b><br>
3438cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * &gt;= 0</p>
3439cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
3440cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     *
3441c7c569d5e42c1d7c17881fd89dcbbbab42dafea1Eino-Ville Talvala     * @see CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN
3442cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * @see CameraCharacteristics#SENSOR_INFO_WHITE_LEVEL
3443cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * @see CameraCharacteristics#SENSOR_OPTICAL_BLACK_REGIONS
3444cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     * @see CaptureRequest#SENSOR_SENSITIVITY
3445cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He     */
3446cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He    @PublicKey
3447cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He    public static final Key<Integer> SENSOR_DYNAMIC_WHITE_LEVEL =
3448cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He            new Key<Integer>("android.sensor.dynamicWhiteLevel", int.class);
3449cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He
3450cd950b682c5007119ab44bd8c822d28497e11fc6Zhijun He    /**
3451ba93fe6468ef14865ec341bc14fc4a1dc7e88704Zhijun He     * <p>Quality of lens shading correction applied
3452ba93fe6468ef14865ec341bc14fc4a1dc7e88704Zhijun He     * to the image data.</p>
3453ba93fe6468ef14865ec341bc14fc4a1dc7e88704Zhijun He     * <p>When set to OFF mode, no lens shading correction will be applied by the
3454ba93fe6468ef14865ec341bc14fc4a1dc7e88704Zhijun He     * camera device, and an identity lens shading map data will be provided
3455ba93fe6468ef14865ec341bc14fc4a1dc7e88704Zhijun He     * if <code>{@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} == ON</code>. For example, for lens
3456fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * shading map with size of <code>[ 4, 3 ]</code>,
3457fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * the output {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap} for this case will be an identity
3458fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * map shown below:</p>
3459ba93fe6468ef14865ec341bc14fc4a1dc7e88704Zhijun He     * <pre><code>[ 1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
3460fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *  1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
3461fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *  1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
3462fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *  1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
3463fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *  1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0,
3464fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *  1.0, 1.0, 1.0, 1.0,  1.0, 1.0, 1.0, 1.0 ]
3465ba93fe6468ef14865ec341bc14fc4a1dc7e88704Zhijun He     * </code></pre>
3466fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>When set to other modes, lens shading correction will be applied by the camera
3467fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * device. Applications can request lens shading map data by setting
3468fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} to ON, and then the camera device will provide lens
3469fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * shading map data in {@link CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP android.statistics.lensShadingCorrectionMap}; the returned shading map
3470fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * data will be the one applied by the camera device for this capture request.</p>
3471fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>The shading map data may depend on the auto-exposure (AE) and AWB statistics, therefore
3472fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * the reliability of the map data may be affected by the AE and AWB algorithms. When AE and
3473fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-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>
3474fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * OFF), to get best results, it is recommended that the applications wait for the AE and AWB
3475fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * to be converged before using the returned shading map data.</p>
3476fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
3477fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
3478fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #SHADING_MODE_OFF OFF}</li>
3479fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #SHADING_MODE_FAST FAST}</li>
3480fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #SHADING_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
3481fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
3482e4aa2831ce6a07a6454ebd61675d9ac432f8f492Yin-Chia Yeh     * <p><b>Available values for this device:</b><br>
3483e4aa2831ce6a07a6454ebd61675d9ac432f8f492Yin-Chia Yeh     * {@link CameraCharacteristics#SHADING_AVAILABLE_MODES android.shading.availableModes}</p>
34844b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
34854b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Full capability</b> -
34864b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
34874b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3488ba93fe6468ef14865ec341bc14fc4a1dc7e88704Zhijun He     *
3489fa7c755a920dc0209efa15a65bfdd2881cb42141Zhijun He     * @see CaptureRequest#CONTROL_AE_MODE
3490fa7c755a920dc0209efa15a65bfdd2881cb42141Zhijun He     * @see CaptureRequest#CONTROL_AWB_MODE
34914b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3492e4aa2831ce6a07a6454ebd61675d9ac432f8f492Yin-Chia Yeh     * @see CameraCharacteristics#SHADING_AVAILABLE_MODES
3493fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * @see CaptureResult#STATISTICS_LENS_SHADING_CORRECTION_MAP
3494ba93fe6468ef14865ec341bc14fc4a1dc7e88704Zhijun He     * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
3495ba93fe6468ef14865ec341bc14fc4a1dc7e88704Zhijun He     * @see #SHADING_MODE_OFF
3496ba93fe6468ef14865ec341bc14fc4a1dc7e88704Zhijun He     * @see #SHADING_MODE_FAST
3497ba93fe6468ef14865ec341bc14fc4a1dc7e88704Zhijun He     * @see #SHADING_MODE_HIGH_QUALITY
3498ba93fe6468ef14865ec341bc14fc4a1dc7e88704Zhijun He     */
34996c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
3500ba93fe6468ef14865ec341bc14fc4a1dc7e88704Zhijun He    public static final Key<Integer> SHADING_MODE =
3501ba93fe6468ef14865ec341bc14fc4a1dc7e88704Zhijun He            new Key<Integer>("android.shading.mode", int.class);
3502ba93fe6468ef14865ec341bc14fc4a1dc7e88704Zhijun He
3503ba93fe6468ef14865ec341bc14fc4a1dc7e88704Zhijun He    /**
3504fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Operating mode for the face detector
3505b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * unit.</p>
3506ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>Whether face detection is enabled, and whether it
35075a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * should output just the basic fields or the full set of
3508fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * fields.</p>
3509fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
3510fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
3511fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #STATISTICS_FACE_DETECT_MODE_OFF OFF}</li>
3512fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #STATISTICS_FACE_DETECT_MODE_SIMPLE SIMPLE}</li>
3513fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #STATISTICS_FACE_DETECT_MODE_FULL FULL}</li>
3514fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
3515fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Available values for this device:</b><br>
3516fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}</p>
3517fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>This key is available on all devices.</p>
35180da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     *
35190da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES
35205a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #STATISTICS_FACE_DETECT_MODE_OFF
35215a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE
35225a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #STATISTICS_FACE_DETECT_MODE_FULL
35235a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
35246c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
35255a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Integer> STATISTICS_FACE_DETECT_MODE =
35265a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Integer>("android.statistics.faceDetectMode", int.class);
35275a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
35285a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
3529e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * <p>List of unique IDs for detected faces.</p>
3530e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * <p>Each detected face is given a unique ID that is valid for as long as the face is visible
3531e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * to the camera device.  A face that leaves the field of view and later returns may be
3532e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * assigned a new ID.</p>
35334b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL
35344b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * This key is available on all devices.</p>
3535e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     *
3536e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
35377f80d6f74125b25a23622719d27cb1cf0c6194f6Zhijun He     * @hide
35385a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
35395a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<int[]> STATISTICS_FACE_IDS =
35405a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<int[]>("android.statistics.faceIds", int[].class);
35415a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
35425a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
3543ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>List of landmarks for detected
3544e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * faces.</p>
3545e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * <p>The coordinate system is that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
3546e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * <code>(0, 0)</code> being the top-left pixel of the active array.</p>
35474b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} == FULL
35484b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * This key is available on all devices.</p>
3549e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     *
3550e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3551e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
35527f80d6f74125b25a23622719d27cb1cf0c6194f6Zhijun He     * @hide
35535a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
35545a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<int[]> STATISTICS_FACE_LANDMARKS =
35555a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<int[]>("android.statistics.faceLandmarks", int[].class);
35565a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
35575a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
3558ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>List of the bounding rectangles for detected
3559e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * faces.</p>
3560e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * <p>The coordinate system is that of {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with
3561e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * <code>(0, 0)</code> being the top-left pixel of the active array.</p>
35624b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} != OFF
35634b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * This key is available on all devices.</p>
3564e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     *
3565e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
3566e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
35677f80d6f74125b25a23622719d27cb1cf0c6194f6Zhijun He     * @hide
35685a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
35695a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<android.graphics.Rect[]> STATISTICS_FACE_RECTANGLES =
35705a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<android.graphics.Rect[]>("android.statistics.faceRectangles", android.graphics.Rect[].class);
35715a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
35725a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
3573ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>List of the face confidence scores for
3574ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * detected faces</p>
3575e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} != OFF.</p>
3576fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
3577fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * 1-100</p>
35784b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
3579e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     *
3580e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
35817f80d6f74125b25a23622719d27cb1cf0c6194f6Zhijun He     * @hide
35825a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
35835a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<byte[]> STATISTICS_FACE_SCORES =
35845a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<byte[]>("android.statistics.faceScores", byte[].class);
35855a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
35865a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
358772f9f0a96e4476ef231d5001cb30521ad4ce5b1eIgor Murashkin     * <p>List of the faces detected through camera face detection
3588fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * in this capture.</p>
358972f9f0a96e4476ef231d5001cb30521ad4ce5b1eIgor Murashkin     * <p>Only available if {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} <code>!=</code> OFF.</p>
35904b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
359172f9f0a96e4476ef231d5001cb30521ad4ce5b1eIgor Murashkin     *
359272f9f0a96e4476ef231d5001cb30521ad4ce5b1eIgor Murashkin     * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
359372f9f0a96e4476ef231d5001cb30521ad4ce5b1eIgor Murashkin     */
35946c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
35956c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @SyntheticKey
359672f9f0a96e4476ef231d5001cb30521ad4ce5b1eIgor Murashkin    public static final Key<android.hardware.camera2.params.Face[]> STATISTICS_FACES =
359772f9f0a96e4476ef231d5001cb30521ad4ce5b1eIgor Murashkin            new Key<android.hardware.camera2.params.Face[]>("android.statistics.faces", android.hardware.camera2.params.Face[].class);
359872f9f0a96e4476ef231d5001cb30521ad4ce5b1eIgor Murashkin
359972f9f0a96e4476ef231d5001cb30521ad4ce5b1eIgor Murashkin    /**
36007a9b30e9e3e45d387d2fc0cb2bd2eb79da7dd268Igor Murashkin     * <p>The shading map is a low-resolution floating-point map
36017a9b30e9e3e45d387d2fc0cb2bd2eb79da7dd268Igor Murashkin     * that lists the coefficients used to correct for vignetting, for each
36027a9b30e9e3e45d387d2fc0cb2bd2eb79da7dd268Igor Murashkin     * Bayer color channel.</p>
3603c62cea89cebf85b5ecddd50e6f4a805eb5252e20Eino-Ville Talvala     * <p>The map provided here is the same map that is used by the camera device to
3604c62cea89cebf85b5ecddd50e6f4a805eb5252e20Eino-Ville Talvala     * correct both color shading and vignetting for output non-RAW images.</p>
3605c62cea89cebf85b5ecddd50e6f4a805eb5252e20Eino-Ville Talvala     * <p>When there is no lens shading correction applied to RAW
3606c62cea89cebf85b5ecddd50e6f4a805eb5252e20Eino-Ville Talvala     * output images ({@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied} <code>==</code>
3607c62cea89cebf85b5ecddd50e6f4a805eb5252e20Eino-Ville Talvala     * false), this map is the complete lens shading correction
3608c62cea89cebf85b5ecddd50e6f4a805eb5252e20Eino-Ville Talvala     * map; when there is some lens shading correction applied to
3609c62cea89cebf85b5ecddd50e6f4a805eb5252e20Eino-Ville Talvala     * the RAW output image ({@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied}<code>==</code> true), this map reports the remaining lens shading
3610c62cea89cebf85b5ecddd50e6f4a805eb5252e20Eino-Ville Talvala     * correction map that needs to be applied to get shading
3611c62cea89cebf85b5ecddd50e6f4a805eb5252e20Eino-Ville Talvala     * corrected images that match the camera device's output for
3612c62cea89cebf85b5ecddd50e6f4a805eb5252e20Eino-Ville Talvala     * non-RAW formats.</p>
3613c62cea89cebf85b5ecddd50e6f4a805eb5252e20Eino-Ville Talvala     * <p>For a complete shading correction map, the least shaded
3614c62cea89cebf85b5ecddd50e6f4a805eb5252e20Eino-Ville Talvala     * section of the image will have a gain factor of 1; all
3615c62cea89cebf85b5ecddd50e6f4a805eb5252e20Eino-Ville Talvala     * other sections will have gains above 1.</p>
36160da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map
3617c62cea89cebf85b5ecddd50e6f4a805eb5252e20Eino-Ville Talvala     * will take into account the colorCorrection settings.</p>
36187a9b30e9e3e45d387d2fc0cb2bd2eb79da7dd268Igor Murashkin     * <p>The shading map is for the entire active pixel array, and is not
36197a9b30e9e3e45d387d2fc0cb2bd2eb79da7dd268Igor Murashkin     * affected by the crop region specified in the request. Each shading map
36207a9b30e9e3e45d387d2fc0cb2bd2eb79da7dd268Igor Murashkin     * entry is the value of the shading compensation map over a specific
36217a9b30e9e3e45d387d2fc0cb2bd2eb79da7dd268Igor Murashkin     * pixel on the sensor.  Specifically, with a (N x M) resolution shading
36227a9b30e9e3e45d387d2fc0cb2bd2eb79da7dd268Igor Murashkin     * map, and an active pixel array size (W x H), shading map entry
36237a9b30e9e3e45d387d2fc0cb2bd2eb79da7dd268Igor Murashkin     * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at
36247a9b30e9e3e45d387d2fc0cb2bd2eb79da7dd268Igor Murashkin     * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
36257a9b30e9e3e45d387d2fc0cb2bd2eb79da7dd268Igor Murashkin     * The map is assumed to be bilinearly interpolated between the sample points.</p>
36267a9b30e9e3e45d387d2fc0cb2bd2eb79da7dd268Igor Murashkin     * <p>The channel order is [R, Geven, Godd, B], where Geven is the green
36277a9b30e9e3e45d387d2fc0cb2bd2eb79da7dd268Igor Murashkin     * channel for the even rows of a Bayer pattern, and Godd is the odd rows.
3628574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     * The shading map is stored in a fully interleaved format.</p>
3629c62cea89cebf85b5ecddd50e6f4a805eb5252e20Eino-Ville Talvala     * <p>The shading map will generally have on the order of 30-40 rows and columns,
3630c62cea89cebf85b5ecddd50e6f4a805eb5252e20Eino-Ville Talvala     * and will be smaller than 64x64.</p>
3631574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     * <p>As an example, given a very small map defined as:</p>
3632574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     * <pre><code>width,height = [ 4, 3 ]
3633574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     * values =
3634574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     * [ 1.3, 1.2, 1.15, 1.2,  1.2, 1.2, 1.15, 1.2,
3635fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *     1.1, 1.2, 1.2, 1.2,  1.3, 1.2, 1.3, 1.3,
3636fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   1.2, 1.2, 1.25, 1.1,  1.1, 1.1, 1.1, 1.0,
3637fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *     1.0, 1.0, 1.0, 1.0,  1.2, 1.3, 1.25, 1.2,
3638fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   1.3, 1.2, 1.2, 1.3,   1.2, 1.15, 1.1, 1.2,
3639fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *     1.2, 1.1, 1.0, 1.2,  1.3, 1.15, 1.2, 1.3 ]
3640574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     * </code></pre>
3641574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     * <p>The low-resolution scaling map images for each channel are
3642574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     * (displayed using nearest-neighbor interpolation):</p>
3643574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     * <p><img alt="Red lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" />
3644574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     * <img alt="Green (even rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" />
3645574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     * <img alt="Green (odd rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" />
3646574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     * <img alt="Blue lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/blue_shading.png" /></p>
3647574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     * <p>As a visualization only, inverting the full-color map to recover an
3648574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     * image of a gray wall (using bicubic interpolation for visual quality) as captured by the sensor gives:</p>
3649574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     * <p><img alt="Image of a uniform white wall (inverse shading map)" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/inv_shading.png" /></p>
3650fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
3651fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * Each gain factor is &gt;= 1</p>
36524b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
36534b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Full capability</b> -
36544b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
36554b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3656574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     *
3657574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     * @see CaptureRequest#COLOR_CORRECTION_MODE
36584b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3659c62cea89cebf85b5ecddd50e6f4a805eb5252e20Eino-Ville Talvala     * @see CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED
3660574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     */
36616c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
3662574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk    public static final Key<android.hardware.camera2.params.LensShadingMap> STATISTICS_LENS_SHADING_CORRECTION_MAP =
3663574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk            new Key<android.hardware.camera2.params.LensShadingMap>("android.statistics.lensShadingCorrectionMap", android.hardware.camera2.params.LensShadingMap.class);
3664574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk
3665574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk    /**
3666574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     * <p>The shading map is a low-resolution floating-point map
366743210fe2e8e75ef0dad80282197b224d6b358f00Zhijun He     * that lists the coefficients used to correct for vignetting and color shading,
366843210fe2e8e75ef0dad80282197b224d6b358f00Zhijun He     * for each Bayer color channel of RAW image data.</p>
3669c62cea89cebf85b5ecddd50e6f4a805eb5252e20Eino-Ville Talvala     * <p>The map provided here is the same map that is used by the camera device to
3670c62cea89cebf85b5ecddd50e6f4a805eb5252e20Eino-Ville Talvala     * correct both color shading and vignetting for output non-RAW images.</p>
3671c62cea89cebf85b5ecddd50e6f4a805eb5252e20Eino-Ville Talvala     * <p>When there is no lens shading correction applied to RAW
3672c62cea89cebf85b5ecddd50e6f4a805eb5252e20Eino-Ville Talvala     * output images ({@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied} <code>==</code>
3673c62cea89cebf85b5ecddd50e6f4a805eb5252e20Eino-Ville Talvala     * false), this map is the complete lens shading correction
3674c62cea89cebf85b5ecddd50e6f4a805eb5252e20Eino-Ville Talvala     * map; when there is some lens shading correction applied to
3675c62cea89cebf85b5ecddd50e6f4a805eb5252e20Eino-Ville Talvala     * the RAW output image ({@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied}<code>==</code> true), this map reports the remaining lens shading
3676c62cea89cebf85b5ecddd50e6f4a805eb5252e20Eino-Ville Talvala     * correction map that needs to be applied to get shading
3677c62cea89cebf85b5ecddd50e6f4a805eb5252e20Eino-Ville Talvala     * corrected images that match the camera device's output for
3678c62cea89cebf85b5ecddd50e6f4a805eb5252e20Eino-Ville Talvala     * non-RAW formats.</p>
3679c62cea89cebf85b5ecddd50e6f4a805eb5252e20Eino-Ville Talvala     * <p>For a complete shading correction map, the least shaded
3680c62cea89cebf85b5ecddd50e6f4a805eb5252e20Eino-Ville Talvala     * section of the image will have a gain factor of 1; all
3681c62cea89cebf85b5ecddd50e6f4a805eb5252e20Eino-Ville Talvala     * other sections will have gains above 1.</p>
3682574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     * <p>When {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} = TRANSFORM_MATRIX, the map
3683c62cea89cebf85b5ecddd50e6f4a805eb5252e20Eino-Ville Talvala     * will take into account the colorCorrection settings.</p>
3684574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     * <p>The shading map is for the entire active pixel array, and is not
3685574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     * affected by the crop region specified in the request. Each shading map
3686574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     * entry is the value of the shading compensation map over a specific
3687574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     * pixel on the sensor.  Specifically, with a (N x M) resolution shading
3688574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     * map, and an active pixel array size (W x H), shading map entry
3689574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     * (x,y) ϵ (0 ... N-1, 0 ... M-1) is the value of the shading map at
3690574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     * pixel ( ((W-1)/(N-1)) * x, ((H-1)/(M-1)) * y) for the four color channels.
3691574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     * The map is assumed to be bilinearly interpolated between the sample points.</p>
3692574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     * <p>The channel order is [R, Geven, Godd, B], where Geven is the green
3693574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     * channel for the even rows of a Bayer pattern, and Godd is the odd rows.
36947a9b30e9e3e45d387d2fc0cb2bd2eb79da7dd268Igor Murashkin     * The shading map is stored in a fully interleaved format, and its size
3695574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     * is provided in the camera static metadata by android.lens.info.shadingMapSize.</p>
3696c62cea89cebf85b5ecddd50e6f4a805eb5252e20Eino-Ville Talvala     * <p>The shading map will generally have on the order of 30-40 rows and columns,
3697c62cea89cebf85b5ecddd50e6f4a805eb5252e20Eino-Ville Talvala     * and will be smaller than 64x64.</p>
36987a9b30e9e3e45d387d2fc0cb2bd2eb79da7dd268Igor Murashkin     * <p>As an example, given a very small map defined as:</p>
3699574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     * <pre><code>android.lens.info.shadingMapSize = [ 4, 3 ]
3700574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     * android.statistics.lensShadingMap =
37017a9b30e9e3e45d387d2fc0cb2bd2eb79da7dd268Igor Murashkin     * [ 1.3, 1.2, 1.15, 1.2,  1.2, 1.2, 1.15, 1.2,
3702fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *     1.1, 1.2, 1.2, 1.2,  1.3, 1.2, 1.3, 1.3,
3703fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   1.2, 1.2, 1.25, 1.1,  1.1, 1.1, 1.1, 1.0,
3704fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *     1.0, 1.0, 1.0, 1.0,  1.2, 1.3, 1.25, 1.2,
3705fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   1.3, 1.2, 1.2, 1.3,   1.2, 1.15, 1.1, 1.2,
3706fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *     1.2, 1.1, 1.0, 1.2,  1.3, 1.15, 1.2, 1.3 ]
37077a9b30e9e3e45d387d2fc0cb2bd2eb79da7dd268Igor Murashkin     * </code></pre>
37087a9b30e9e3e45d387d2fc0cb2bd2eb79da7dd268Igor Murashkin     * <p>The low-resolution scaling map images for each channel are
37097a9b30e9e3e45d387d2fc0cb2bd2eb79da7dd268Igor Murashkin     * (displayed using nearest-neighbor interpolation):</p>
37107a9b30e9e3e45d387d2fc0cb2bd2eb79da7dd268Igor Murashkin     * <p><img alt="Red lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/red_shading.png" />
37117a9b30e9e3e45d387d2fc0cb2bd2eb79da7dd268Igor Murashkin     * <img alt="Green (even rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_e_shading.png" />
37127a9b30e9e3e45d387d2fc0cb2bd2eb79da7dd268Igor Murashkin     * <img alt="Green (odd rows) lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/green_o_shading.png" />
37137a9b30e9e3e45d387d2fc0cb2bd2eb79da7dd268Igor Murashkin     * <img alt="Blue lens shading map" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/blue_shading.png" /></p>
37147a9b30e9e3e45d387d2fc0cb2bd2eb79da7dd268Igor Murashkin     * <p>As a visualization only, inverting the full-color map to recover an
3715e4aa2831ce6a07a6454ebd61675d9ac432f8f492Yin-Chia Yeh     * image of a gray wall (using bicubic interpolation for visual quality)
3716e4aa2831ce6a07a6454ebd61675d9ac432f8f492Yin-Chia Yeh     * as captured by the sensor gives:</p>
37177a9b30e9e3e45d387d2fc0cb2bd2eb79da7dd268Igor Murashkin     * <p><img alt="Image of a uniform white wall (inverse shading map)" src="../../../../images/camera2/metadata/android.statistics.lensShadingMap/inv_shading.png" /></p>
3718e4aa2831ce6a07a6454ebd61675d9ac432f8f492Yin-Chia Yeh     * <p>Note that the RAW image data might be subject to lens shading
3719e4aa2831ce6a07a6454ebd61675d9ac432f8f492Yin-Chia Yeh     * correction not reported on this map. Query
3720e4aa2831ce6a07a6454ebd61675d9ac432f8f492Yin-Chia Yeh     * {@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied} to see if RAW image data has subject
3721e4aa2831ce6a07a6454ebd61675d9ac432f8f492Yin-Chia Yeh     * to lens shading correction. If {@link CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED android.sensor.info.lensShadingApplied}
3722e4aa2831ce6a07a6454ebd61675d9ac432f8f492Yin-Chia Yeh     * is TRUE, the RAW image data is subject to partial or full lens shading
3723e4aa2831ce6a07a6454ebd61675d9ac432f8f492Yin-Chia Yeh     * correction. In the case full lens shading correction is applied to RAW
3724e4aa2831ce6a07a6454ebd61675d9ac432f8f492Yin-Chia Yeh     * images, the gain factor map reported in this key will contain all 1.0 gains.
3725e4aa2831ce6a07a6454ebd61675d9ac432f8f492Yin-Chia Yeh     * In other words, the map reported in this key is the remaining lens shading
3726e4aa2831ce6a07a6454ebd61675d9ac432f8f492Yin-Chia Yeh     * that needs to be applied on the RAW image to get images without lens shading
3727e4aa2831ce6a07a6454ebd61675d9ac432f8f492Yin-Chia Yeh     * artifacts. See {@link CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_RAW android.request.maxNumOutputRaw} for a list of RAW image
3728e4aa2831ce6a07a6454ebd61675d9ac432f8f492Yin-Chia Yeh     * formats.</p>
3729fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
3730fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * Each gain factor is &gt;= 1</p>
37314b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
37324b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Full capability</b> -
37334b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
37344b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
37350da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     *
37365f2a47f3dedfc7859457067d8cdcdbfc28ee08acZhijun He     * @see CaptureRequest#COLOR_CORRECTION_MODE
37374b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3738e4aa2831ce6a07a6454ebd61675d9ac432f8f492Yin-Chia Yeh     * @see CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_RAW
3739e4aa2831ce6a07a6454ebd61675d9ac432f8f492Yin-Chia Yeh     * @see CameraCharacteristics#SENSOR_INFO_LENS_SHADING_APPLIED
3740574936894d3044445a272b39f2d925af40ece5d8Ruben Brunk     * @hide
37415a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
37425a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<float[]> STATISTICS_LENS_SHADING_MAP =
37435a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<float[]>("android.statistics.lensShadingMap", float[].class);
37445a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
37455a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
3746ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>The best-fit color channel gains calculated
3747cc28a41b48bc687002a9e1fc436d00ca6f0c3692Zhijun He     * by the camera device's statistics units for the current output frame.</p>
3748ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>This may be different than the gains used for this frame,
37495a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * since statistics processing on data from a new frame
37505a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * typically completes after the transform has already been
3751ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * applied to that frame.</p>
3752ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>The 4 channel gains are defined in Bayer domain,
37530da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * see {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} for details.</p>
3754b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <p>This value should always be calculated by the auto-white balance (AWB) block,
3755ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * regardless of the android.control.* current values.</p>
3756aef3b7ed9f2a27aed9aecef030432d1100a60406Igor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
37570da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     *
37580da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * @see CaptureRequest#COLOR_CORRECTION_GAINS
37599c595174ccaaf3d36315c4a100e47ee4369073f6Igor Murashkin     * @deprecated
3760aef3b7ed9f2a27aed9aecef030432d1100a60406Igor Murashkin     * @hide
37615a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
37629c595174ccaaf3d36315c4a100e47ee4369073f6Igor Murashkin    @Deprecated
37635a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<float[]> STATISTICS_PREDICTED_COLOR_GAINS =
37645a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<float[]>("android.statistics.predictedColorGains", float[].class);
37655a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
37665a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
3767ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>The best-fit color transform matrix estimate
3768cc28a41b48bc687002a9e1fc436d00ca6f0c3692Zhijun He     * calculated by the camera device's statistics units for the current
3769cc28a41b48bc687002a9e1fc436d00ca6f0c3692Zhijun He     * output frame.</p>
3770cc28a41b48bc687002a9e1fc436d00ca6f0c3692Zhijun He     * <p>The camera device will provide the estimate from its
37715a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * statistics unit on the white balance transforms to use
3772cc28a41b48bc687002a9e1fc436d00ca6f0c3692Zhijun He     * for the next frame. These are the values the camera device believes
37735a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * are the best fit for the current output frame. This may
37745a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * be different than the transform used for this frame, since
37755a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * statistics processing on data from a new frame typically
37765a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * completes after the transform has already been applied to
3777ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * that frame.</p>
3778ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>These estimates must be provided for all frames, even if
3779ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * capture settings and color transforms are set by the application.</p>
3780b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1Eino-Ville Talvala     * <p>This value should always be calculated by the auto-white balance (AWB) block,
3781ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * regardless of the android.control.* current values.</p>
3782aef3b7ed9f2a27aed9aecef030432d1100a60406Igor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
37839c595174ccaaf3d36315c4a100e47ee4369073f6Igor Murashkin     * @deprecated
3784aef3b7ed9f2a27aed9aecef030432d1100a60406Igor Murashkin     * @hide
37855a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
37869c595174ccaaf3d36315c4a100e47ee4369073f6Igor Murashkin    @Deprecated
37875a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Rational[]> STATISTICS_PREDICTED_COLOR_TRANSFORM =
37885a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Rational[]>("android.statistics.predictedColorTransform", Rational[].class);
37895a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
37905a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
3791208fb6c321acb7bcc3b666633e1ada03d2799cb0Zhijun He     * <p>The camera device estimated scene illumination lighting
3792208fb6c321acb7bcc3b666633e1ada03d2799cb0Zhijun He     * frequency.</p>
3793208fb6c321acb7bcc3b666633e1ada03d2799cb0Zhijun He     * <p>Many light sources, such as most fluorescent lights, flicker at a rate
3794208fb6c321acb7bcc3b666633e1ada03d2799cb0Zhijun He     * that depends on the local utility power standards. This flicker must be
3795208fb6c321acb7bcc3b666633e1ada03d2799cb0Zhijun He     * accounted for by auto-exposure routines to avoid artifacts in captured images.
3796208fb6c321acb7bcc3b666633e1ada03d2799cb0Zhijun He     * The camera device uses this entry to tell the application what the scene
3797208fb6c321acb7bcc3b666633e1ada03d2799cb0Zhijun He     * illuminant frequency is.</p>
3798208fb6c321acb7bcc3b666633e1ada03d2799cb0Zhijun He     * <p>When manual exposure control is enabled
3799e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * (<code>{@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} == OFF</code> or <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} ==
3800e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * OFF</code>), the {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} doesn't perform
3801e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * antibanding, and the application can ensure it selects
3802e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * exposure times that do not cause banding issues by looking
3803e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * into this metadata field. See
3804e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} for more details.</p>
3805e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * <p>Reports NONE if there doesn't appear to be flickering illumination.</p>
3806fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
3807fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
3808fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #STATISTICS_SCENE_FLICKER_NONE NONE}</li>
3809fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #STATISTICS_SCENE_FLICKER_50HZ 50HZ}</li>
3810fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #STATISTICS_SCENE_FLICKER_60HZ 60HZ}</li>
3811fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
38124b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
38134b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Full capability</b> -
38144b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
38154b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
3816208fb6c321acb7bcc3b666633e1ada03d2799cb0Zhijun He     *
3817208fb6c321acb7bcc3b666633e1ada03d2799cb0Zhijun He     * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
3818208fb6c321acb7bcc3b666633e1ada03d2799cb0Zhijun He     * @see CaptureRequest#CONTROL_AE_MODE
3819208fb6c321acb7bcc3b666633e1ada03d2799cb0Zhijun He     * @see CaptureRequest#CONTROL_MODE
38204b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
38215a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #STATISTICS_SCENE_FLICKER_NONE
38225a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #STATISTICS_SCENE_FLICKER_50HZ
38235a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #STATISTICS_SCENE_FLICKER_60HZ
38245a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
38256c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
38265a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Integer> STATISTICS_SCENE_FLICKER =
38275a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Integer>("android.statistics.sceneFlicker", int.class);
38285a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
38295a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
3830fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>Operating mode for hot pixel map generation.</p>
3831fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-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}.
3832fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * If set to <code>false</code>, no hot pixel map will be returned.</p>
3833fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
3834fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES android.statistics.info.availableHotPixelMapModes}</p>
38354b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
38369d454fd6096dad310a476d50b5e7175e38cdc4eaRuben Brunk     *
38379d454fd6096dad310a476d50b5e7175e38cdc4eaRuben Brunk     * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP
38389d454fd6096dad310a476d50b5e7175e38cdc4eaRuben Brunk     * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES
38399d454fd6096dad310a476d50b5e7175e38cdc4eaRuben Brunk     */
38406c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
38419d454fd6096dad310a476d50b5e7175e38cdc4eaRuben Brunk    public static final Key<Boolean> STATISTICS_HOT_PIXEL_MAP_MODE =
38429d454fd6096dad310a476d50b5e7175e38cdc4eaRuben Brunk            new Key<Boolean>("android.statistics.hotPixelMapMode", boolean.class);
38439d454fd6096dad310a476d50b5e7175e38cdc4eaRuben Brunk
38449d454fd6096dad310a476d50b5e7175e38cdc4eaRuben Brunk    /**
38459d454fd6096dad310a476d50b5e7175e38cdc4eaRuben Brunk     * <p>List of <code>(x, y)</code> coordinates of hot/defective pixels on the sensor.</p>
38469d454fd6096dad310a476d50b5e7175e38cdc4eaRuben Brunk     * <p>A coordinate <code>(x, y)</code> must lie between <code>(0, 0)</code>, and
38479d454fd6096dad310a476d50b5e7175e38cdc4eaRuben Brunk     * <code>(width - 1, height - 1)</code> (inclusive), which are the top-left and
38489d454fd6096dad310a476d50b5e7175e38cdc4eaRuben Brunk     * bottom-right of the pixel array, respectively. The width and
38499d454fd6096dad310a476d50b5e7175e38cdc4eaRuben Brunk     * height dimensions are given in {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.
38509d454fd6096dad310a476d50b5e7175e38cdc4eaRuben Brunk     * This may include hot pixels that lie outside of the active array
38519d454fd6096dad310a476d50b5e7175e38cdc4eaRuben Brunk     * bounds given by {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
3852fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br></p>
3853fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>n &lt;= number of pixels on the sensor.
3854fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * The <code>(x, y)</code> coordinates must be bounded by
3855fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p>
38564b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
38579d454fd6096dad310a476d50b5e7175e38cdc4eaRuben Brunk     *
38589d454fd6096dad310a476d50b5e7175e38cdc4eaRuben Brunk     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
38599d454fd6096dad310a476d50b5e7175e38cdc4eaRuben Brunk     * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
38609d454fd6096dad310a476d50b5e7175e38cdc4eaRuben Brunk     */
38616c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
38628490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh    public static final Key<android.graphics.Point[]> STATISTICS_HOT_PIXEL_MAP =
38638490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh            new Key<android.graphics.Point[]>("android.statistics.hotPixelMap", android.graphics.Point[].class);
38649d454fd6096dad310a476d50b5e7175e38cdc4eaRuben Brunk
38659d454fd6096dad310a476d50b5e7175e38cdc4eaRuben Brunk    /**
3866379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <p>Whether the camera device will output the lens
3867379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * shading map in output result metadata.</p>
3868379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * <p>When set to ON,
3869e600d6ad60373821472e6338792109fa3103f7e2Eino-Ville Talvala     * android.statistics.lensShadingMap will be provided in
3870379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * the output result metadata.</p>
3871fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>ON is always supported on devices with the RAW capability.</p>
3872fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
3873fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
3874fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_OFF OFF}</li>
3875fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #STATISTICS_LENS_SHADING_MAP_MODE_ON ON}</li>
3876fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
3877e4aa2831ce6a07a6454ebd61675d9ac432f8f492Yin-Chia Yeh     * <p><b>Available values for this device:</b><br>
3878e4aa2831ce6a07a6454ebd61675d9ac432f8f492Yin-Chia Yeh     * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES android.statistics.info.availableLensShadingMapModes}</p>
38794b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
38804b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Full capability</b> -
38814b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
38824b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
38834b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     *
38844b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3885e4aa2831ce6a07a6454ebd61675d9ac432f8f492Yin-Chia Yeh     * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES
3886379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF
3887379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON
3888379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He     */
38896c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
3890379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He    public static final Key<Integer> STATISTICS_LENS_SHADING_MAP_MODE =
3891379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He            new Key<Integer>("android.statistics.lensShadingMapMode", int.class);
3892379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He
3893379af01292ecf4a46a465c48a7da55a68c0a9f49Zhijun He    /**
3894ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>Tonemapping / contrast / gamma curve for the blue
3895e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
3896e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * CONTRAST_CURVE.</p>
38978490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <p>See android.tonemap.curveRed for more details.</p>
38984b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
38994b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Full capability</b> -
39004b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
39014b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
39020da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     *
39034b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
39045f2a47f3dedfc7859457067d8cdcdbfc28ee08acZhijun He     * @see CaptureRequest#TONEMAP_MODE
39058490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * @hide
39065a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
39073ffd70554f85bd1ee54354f2d5c44e1bc0878227Zhijun He    public static final Key<float[]> TONEMAP_CURVE_BLUE =
39083ffd70554f85bd1ee54354f2d5c44e1bc0878227Zhijun He            new Key<float[]>("android.tonemap.curveBlue", float[].class);
39095a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
39105a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
3911ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>Tonemapping / contrast / gamma curve for the green
3912e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
3913e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * CONTRAST_CURVE.</p>
39148490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <p>See android.tonemap.curveRed for more details.</p>
39154b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
39164b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Full capability</b> -
39174b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
39184b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
39190da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     *
39204b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
39215f2a47f3dedfc7859457067d8cdcdbfc28ee08acZhijun He     * @see CaptureRequest#TONEMAP_MODE
39228490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * @hide
39235a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
39243ffd70554f85bd1ee54354f2d5c44e1bc0878227Zhijun He    public static final Key<float[]> TONEMAP_CURVE_GREEN =
39253ffd70554f85bd1ee54354f2d5c44e1bc0878227Zhijun He            new Key<float[]>("android.tonemap.curveGreen", float[].class);
39265a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
39275a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
3928ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>Tonemapping / contrast / gamma curve for the red
3929e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
3930e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * CONTRAST_CURVE.</p>
3931e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * <p>Each channel's curve is defined by an array of control points:</p>
39328490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <pre><code>android.tonemap.curveRed =
3933fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   [ P0in, P0out, P1in, P1out, P2in, P2out, P3in, P3out, ..., PNin, PNout ]
3934870922be2399766078d0a4e42a0158ecb9eb1f86Zhijun He     * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
3935fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p>These are sorted in order of increasing <code>Pin</code>; it is
3936fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * required that input values 0.0 and 1.0 are included in the list to
3937e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * define a complete mapping. For input values between control points,
3938e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * the camera device must linearly interpolate between the control
3939e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * points.</p>
3940e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * <p>Each curve can have an independent number of points, and the number
3941e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * of points can be less than max (that is, the request doesn't have to
3942e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * always provide a curve with number of points equivalent to
3943e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
3944e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * <p>A few examples, and their corresponding graphical mappings; these
3945e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * only specify the red channel and the precision is limited to 4
3946e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * digits, for conciseness.</p>
3947e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * <p>Linear mapping:</p>
39488490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <pre><code>android.tonemap.curveRed = [ 0, 0, 1.0, 1.0 ]
3949e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * </code></pre>
3950e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p>
3951e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * <p>Invert mapping:</p>
39528490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <pre><code>android.tonemap.curveRed = [ 0, 1.0, 1.0, 0 ]
3953e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * </code></pre>
3954e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p>
3955e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
39568490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <pre><code>android.tonemap.curveRed = [
3957fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   0.0000, 0.0000, 0.0667, 0.2920, 0.1333, 0.4002, 0.2000, 0.4812,
3958fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   0.2667, 0.5484, 0.3333, 0.6069, 0.4000, 0.6594, 0.4667, 0.7072,
3959fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   0.5333, 0.7515, 0.6000, 0.7928, 0.6667, 0.8317, 0.7333, 0.8685,
3960fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   0.8000, 0.9035, 0.8667, 0.9370, 0.9333, 0.9691, 1.0000, 1.0000 ]
3961e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * </code></pre>
3962e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p>
3963e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
39648490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <pre><code>android.tonemap.curveRed = [
3965fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   0.0000, 0.0000, 0.0667, 0.2864, 0.1333, 0.4007, 0.2000, 0.4845,
3966fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   0.2667, 0.5532, 0.3333, 0.6125, 0.4000, 0.6652, 0.4667, 0.7130,
3967fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   0.5333, 0.7569, 0.6000, 0.7977, 0.6667, 0.8360, 0.7333, 0.8721,
3968fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   0.8000, 0.9063, 0.8667, 0.9389, 0.9333, 0.9701, 1.0000, 1.0000 ]
3969e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * </code></pre>
3970e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p>
3971fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Range of valid values:</b><br>
3972fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * 0-1 on both input and output coordinates, normalized
3973fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * as a floating-point value such that 0 == black and 1 == white.</p>
39744b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
39754b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Full capability</b> -
39764b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
39774b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
39780da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     *
39794b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3980e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
39810da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * @see CaptureRequest#TONEMAP_MODE
39828490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * @hide
39835a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
39845a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<float[]> TONEMAP_CURVE_RED =
39855a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<float[]>("android.tonemap.curveRed", float[].class);
39865a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
39875a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
39888490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <p>Tonemapping / contrast / gamma curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode}
39898490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * is CONTRAST_CURVE.</p>
39908490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <p>The tonemapCurve consist of three curves for each of red, green, and blue
39918490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * channels respectively. The following example uses the red channel as an
39928490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * example. The same logic applies to green and blue channel.
39938490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * Each channel's curve is defined by an array of control points:</p>
39948490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <pre><code>curveRed =
3995fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   [ P0(in, out), P1(in, out), P2(in, out), P3(in, out), ..., PN(in, out) ]
39968490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre>
39978490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <p>These are sorted in order of increasing <code>Pin</code>; it is always
39988490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * guaranteed that input values 0.0 and 1.0 are included in the list to
39998490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * define a complete mapping. For input values between control points,
40008490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * the camera device must linearly interpolate between the control
40018490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * points.</p>
40028490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <p>Each curve can have an independent number of points, and the number
40038490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * of points can be less than max (that is, the request doesn't have to
40048490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * always provide a curve with number of points equivalent to
40058490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p>
40068490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <p>A few examples, and their corresponding graphical mappings; these
40078490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * only specify the red channel and the precision is limited to 4
40088490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * digits, for conciseness.</p>
40098490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <p>Linear mapping:</p>
40108490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <pre><code>curveRed = [ (0, 0), (1.0, 1.0) ]
40118490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * </code></pre>
40128490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p>
40138490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <p>Invert mapping:</p>
40148490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <pre><code>curveRed = [ (0, 1.0), (1.0, 0) ]
40158490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * </code></pre>
40168490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p>
40178490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <p>Gamma 1/2.2 mapping, with 16 control points:</p>
40188490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <pre><code>curveRed = [
4019fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   (0.0000, 0.0000), (0.0667, 0.2920), (0.1333, 0.4002), (0.2000, 0.4812),
4020fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   (0.2667, 0.5484), (0.3333, 0.6069), (0.4000, 0.6594), (0.4667, 0.7072),
4021fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   (0.5333, 0.7515), (0.6000, 0.7928), (0.6667, 0.8317), (0.7333, 0.8685),
4022fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   (0.8000, 0.9035), (0.8667, 0.9370), (0.9333, 0.9691), (1.0000, 1.0000) ]
40238490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * </code></pre>
40248490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p>
40258490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p>
40268490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <pre><code>curveRed = [
4027fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   (0.0000, 0.0000), (0.0667, 0.2864), (0.1333, 0.4007), (0.2000, 0.4845),
4028fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   (0.2667, 0.5532), (0.3333, 0.6125), (0.4000, 0.6652), (0.4667, 0.7130),
4029fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   (0.5333, 0.7569), (0.6000, 0.7977), (0.6667, 0.8360), (0.7333, 0.8721),
4030fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   (0.8000, 0.9063), (0.8667, 0.9389), (0.9333, 0.9701), (1.0000, 1.0000) ]
40318490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * </code></pre>
40328490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p>
40334b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
40344b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Full capability</b> -
40354b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
40364b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
40378490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     *
40384b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
40398490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
40408490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * @see CaptureRequest#TONEMAP_MODE
40418490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     */
40426c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
40436c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @SyntheticKey
40448490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh    public static final Key<android.hardware.camera2.params.TonemapCurve> TONEMAP_CURVE =
40458490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh            new Key<android.hardware.camera2.params.TonemapCurve>("android.tonemap.curve", android.hardware.camera2.params.TonemapCurve.class);
40468490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh
40478490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh    /**
4048e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * <p>High-level global contrast/gamma/tonemapping control.</p>
4049e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * <p>When switching to an application-defined contrast curve by setting
4050e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} to CONTRAST_CURVE, the curve is defined
4051e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * per-channel with a set of <code>(in, out)</code> points that specify the
4052e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * mapping from input high-bit-depth pixel value to the output
4053e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * low-bit-depth value.  Since the actual pixel ranges of both input
4054e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * and output may change depending on the camera pipeline, the values
4055e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * are specified by normalized floating-point numbers.</p>
4056e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * <p>More-complex color mapping operations such as 3D color look-up
4057e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * tables, selective chroma enhancement, or other non-linear color
4058e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * transforms will be disabled when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
4059e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * CONTRAST_CURVE.</p>
4060e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * <p>When using either FAST or HIGH_QUALITY, the camera device will
40618490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * emit its own tonemap curve in {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}.
4062e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * These values are always available, and as close as possible to the
4063e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * actually used nonlinear/nonglobal transforms.</p>
4064fa7c755a920dc0209efa15a65bfdd2881cb42141Zhijun He     * <p>If a request is sent with CONTRAST_CURVE with the camera device's
4065e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * provided curve in FAST or HIGH_QUALITY, the image's tonemap will be
4066e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * roughly the same.</p>
4067fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
4068fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
4069fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #TONEMAP_MODE_CONTRAST_CURVE CONTRAST_CURVE}</li>
4070fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #TONEMAP_MODE_FAST FAST}</li>
4071fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #TONEMAP_MODE_HIGH_QUALITY HIGH_QUALITY}</li>
4072956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh     *   <li>{@link #TONEMAP_MODE_GAMMA_VALUE GAMMA_VALUE}</li>
4073956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh     *   <li>{@link #TONEMAP_MODE_PRESET_CURVE PRESET_CURVE}</li>
4074fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
4075fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Available values for this device:</b><br>
4076fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * {@link CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES android.tonemap.availableToneMapModes}</p>
40774b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
40784b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Full capability</b> -
40794b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
40804b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
40813242f4fb19b77bcd2435cbe710188d012d08b005Igor Murashkin     *
40824b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
40836dc379c7bd34d9707ee2ef819a5a07afc2aa9314Ruben Brunk     * @see CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES
40848490ace76fd350e53de9554c11fca715c5a37aafYin-Chia Yeh     * @see CaptureRequest#TONEMAP_CURVE
4085e0060930cbff1af0486466e03605e6e8ee525302Igor Murashkin     * @see CaptureRequest#TONEMAP_MODE
40865a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #TONEMAP_MODE_CONTRAST_CURVE
40875a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #TONEMAP_MODE_FAST
40885a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @see #TONEMAP_MODE_HIGH_QUALITY
4089956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh     * @see #TONEMAP_MODE_GAMMA_VALUE
4090956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh     * @see #TONEMAP_MODE_PRESET_CURVE
40915a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
40926c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
40935a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Integer> TONEMAP_MODE =
40945a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Integer>("android.tonemap.mode", int.class);
40955a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
40965a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
4097956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh     * <p>Tonemapping curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
4098956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh     * GAMMA_VALUE</p>
4099956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh     * <p>The tonemap curve will be defined the following formula:
4100956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh     * * OUT = pow(IN, 1.0 / gamma)
4101956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh     * where IN and OUT is the input pixel value scaled to range [0.0, 1.0],
4102956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh     * pow is the power function and gamma is the gamma value specified by this
4103956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh     * key.</p>
4104956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh     * <p>The same curve will be applied to all color channels. The camera device
4105956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh     * may clip the input gamma value to its supported range. The actual applied
4106956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh     * value will be returned in capture result.</p>
4107956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh     * <p>The valid range of gamma value varies on different devices, but values
4108956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh     * within [1.0, 5.0] are guaranteed not to be clipped.</p>
4109956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4110956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh     *
4111956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh     * @see CaptureRequest#TONEMAP_MODE
4112956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh     */
4113956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh    @PublicKey
4114956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh    public static final Key<Float> TONEMAP_GAMMA =
4115956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh            new Key<Float>("android.tonemap.gamma", float.class);
4116956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh
4117956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh    /**
4118956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh     * <p>Tonemapping curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is
4119956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh     * PRESET_CURVE</p>
4120956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh     * <p>The tonemap curve will be defined by specified standard.</p>
4121956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh     * <p>sRGB (approximated by 16 control points):</p>
4122956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh     * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p>
4123956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh     * <p>Rec. 709 (approximated by 16 control points):</p>
4124956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh     * <p><img alt="Rec. 709 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/rec709_tonemap.png" /></p>
4125956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh     * <p>Note that above figures show a 16 control points approximation of preset
4126956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh     * curves. Camera devices may apply a different approximation to the curve.</p>
4127956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh     * <p><b>Possible values:</b>
4128956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh     * <ul>
4129956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh     *   <li>{@link #TONEMAP_PRESET_CURVE_SRGB SRGB}</li>
4130956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh     *   <li>{@link #TONEMAP_PRESET_CURVE_REC709 REC709}</li>
4131956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh     * </ul></p>
4132956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4133956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh     *
4134956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh     * @see CaptureRequest#TONEMAP_MODE
4135956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh     * @see #TONEMAP_PRESET_CURVE_SRGB
4136956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh     * @see #TONEMAP_PRESET_CURVE_REC709
4137956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh     */
4138956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh    @PublicKey
4139956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh    public static final Key<Integer> TONEMAP_PRESET_CURVE =
4140956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh            new Key<Integer>("android.tonemap.presetCurve", int.class);
4141956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh
4142956c52b5a09fa6b193b162bdb3aee629323cde2bYin-Chia Yeh    /**
4143ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>This LED is nominally used to indicate to the user
41445a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * that the camera is powered on and may be streaming images back to the
41455a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * Application Processor. In certain rare circumstances, the OS may
41465a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * disable this when video is processed locally and not transmitted to
4147ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * any untrusted applications.</p>
4148ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>In particular, the LED <em>must</em> always be on when the data could be
4149ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * transmitted off the device. The LED <em>should</em> always be on whenever
4150ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * data is stored locally on the device.</p>
4151ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>The LED <em>may</em> be off if a trusted application is using the data that
4152ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * doesn't violate the above rules.</p>
41534b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
41545a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * @hide
41555a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
41565a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Boolean> LED_TRANSMIT =
41575a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Boolean>("android.led.transmit", boolean.class);
41585a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
41595a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /**
4160ace5bf04126f7dd49d75fca9218031f0db02e5ddIgor Murashkin     * <p>Whether black-level compensation is locked
41610956af56a294397325f2695604229ab7550364caEino-Ville Talvala     * to its current values, or is free to vary.</p>
41620956af56a294397325f2695604229ab7550364caEino-Ville Talvala     * <p>Whether the black level offset was locked for this frame.  Should be
41630da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * ON if {@link CaptureRequest#BLACK_LEVEL_LOCK android.blackLevel.lock} was ON in the capture request, unless
41640956af56a294397325f2695604229ab7550364caEino-Ville Talvala     * a change in other capture settings forced the camera device to
41650956af56a294397325f2695604229ab7550364caEino-Ville Talvala     * perform a black level reset.</p>
41664b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
41674b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p><b>Full capability</b> -
41684b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
41694b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
41700da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     *
41710da8bf5dbc8912cf70df14bfa655189a04c75476Eino-Ville Talvala     * @see CaptureRequest#BLACK_LEVEL_LOCK
41724b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
41735a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     */
41746c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin    @PublicKey
41755a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    public static final Key<Boolean> BLACK_LEVEL_LOCK =
41765a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala            new Key<Boolean>("android.blackLevel.lock", boolean.class);
41775a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala
41783865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin    /**
41793865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * <p>The frame number corresponding to the last request
41803865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * with which the output result (metadata + buffers) has been fully
41813865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * synchronized.</p>
41823865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * <p>When a request is submitted to the camera device, there is usually a
41833865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * delay of several frames before the controls get applied. A camera
41843865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * device may either choose to account for this delay by implementing a
41853865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * pipeline and carefully submit well-timed atomic control updates, or
41863865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * it may start streaming control changes that span over several frame
41873865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * boundaries.</p>
41883865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * <p>In the latter case, whenever a request's settings change relative to
41893865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * the previous submitted request, the full set of changes may take
41903865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * multiple frame durations to fully take effect. Some settings may
41913865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * take effect sooner (in less frame durations) than others.</p>
41923865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * <p>While a set of control changes are being propagated, this value
41933865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * will be CONVERGING.</p>
41943865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * <p>Once it is fully known that a set of control changes have been
41953865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * finished propagating, and the resulting updated control settings
41963865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * have been read back by the camera device, this value will be set
41973865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * to a non-negative frame number (corresponding to the request to
41983865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * which the results have synchronized to).</p>
41993865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * <p>Older camera device implementations may not have a way to detect
42003865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * when all camera controls have been applied, and will always set this
42013865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * value to UNKNOWN.</p>
42023865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * <p>FULL capability devices will always have this value set to the
42033865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * frame number of the request corresponding to this result.</p>
42043865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * <p><em>Further details</em>:</p>
42053865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * <ul>
42063865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * <li>Whenever a request differs from the last request, any future
42073865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * results not yet returned may have this value set to CONVERGING (this
42083865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * could include any in-progress captures not yet returned by the camera
42093865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * device, for more details see pipeline considerations below).</li>
42103865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * <li>Submitting a series of multiple requests that differ from the
42113865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * previous request (e.g. r1, r2, r3 s.t. r1 != r2 != r3)
42123865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * moves the new synchronization frame to the last non-repeating
42133865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * request (using the smallest frame number from the contiguous list of
42143865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * repeating requests).</li>
42153865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * <li>Submitting the same request repeatedly will not change this value
42163865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * to CONVERGING, if it was already a non-negative value.</li>
42173865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * <li>When this value changes to non-negative, that means that all of the
42183865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * metadata controls from the request have been applied, all of the
42193865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * metadata controls from the camera device have been read to the
42203865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * updated values (into the result), and all of the graphics buffers
42213865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * corresponding to this result are also synchronized to the request.</li>
42223865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * </ul>
42233865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * <p><em>Pipeline considerations</em>:</p>
42243865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * <p>Submitting a request with updated controls relative to the previously
42253865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * submitted requests may also invalidate the synchronization state
42263865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * of all the results corresponding to currently in-flight requests.</p>
42273865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * <p>In other words, results for this current request and up to
42283865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * {@link CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH android.request.pipelineMaxDepth} prior requests may have their
42293865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * android.sync.frameNumber change to CONVERGING.</p>
4230fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Possible values:</b>
4231fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <ul>
4232fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #SYNC_FRAME_NUMBER_CONVERGING CONVERGING}</li>
4233fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     *   <li>{@link #SYNC_FRAME_NUMBER_UNKNOWN UNKNOWN}</li>
4234fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * </ul></p>
4235fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <p><b>Available values for this device:</b><br>
4236fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * Either a non-negative value corresponding to a
4237fd3e2892f29ded5a25a0a064275b282ce93ed258Eino-Ville Talvala     * <code>frame_number</code>, or one of the two enums (CONVERGING / UNKNOWN).</p>
42384b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin     * <p>This key is available on all devices.</p>
42393865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     *
42403865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * @see CameraCharacteristics#REQUEST_PIPELINE_MAX_DEPTH
42413865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * @see #SYNC_FRAME_NUMBER_CONVERGING
42423865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * @see #SYNC_FRAME_NUMBER_UNKNOWN
42433865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     * @hide
42443865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin     */
42454f91e2a45990b9bfb9e05fb3e7600c44450d4be5Zhijun He    public static final Key<Long> SYNC_FRAME_NUMBER =
42464f91e2a45990b9bfb9e05fb3e7600c44450d4be5Zhijun He            new Key<Long>("android.sync.frameNumber", long.class);
42473865a84255a4e65a5d9790083a1e519b05f40d50Igor Murashkin
42480e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He    /**
42490e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * <p>The amount of exposure time increase factor applied to the original output
42500e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * frame by the application processing before sending for reprocessing.</p>
42510e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * <p>This is optional, and will be supported if the camera device supports YUV_REPROCESSING
42520e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains YUV_REPROCESSING).</p>
42530e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * <p>For some YUV reprocessing use cases, the application may choose to filter the original
42540e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * output frames to effectively reduce the noise to the same level as a frame that was
42550e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * captured with longer exposure time. To be more specific, assuming the original captured
42560e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * images were captured with a sensitivity of S and an exposure time of T, the model in
42570e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * the camera device is that the amount of noise in the image would be approximately what
42580e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * would be expected if the original capture parameters had been a sensitivity of
42590e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * S/effectiveExposureFactor and an exposure time of T*effectiveExposureFactor, rather
42600e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * than S and T respectively. If the captured images were processed by the application
42610e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * before being sent for reprocessing, then the application may have used image processing
42620e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * algorithms and/or multi-frame image fusion to reduce the noise in the
42630e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * application-processed images (input images). By using the effectiveExposureFactor
42640e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * control, the application can communicate to the camera device the actual noise level
42650e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * improvement in the application-processed image. With this information, the camera
42660e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * device can select appropriate noise reduction and edge enhancement parameters to avoid
42670e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * excessive noise reduction ({@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode}) and insufficient edge
42680e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * enhancement ({@link CaptureRequest#EDGE_MODE android.edge.mode}) being applied to the reprocessed frames.</p>
42690e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * <p>For example, for multi-frame image fusion use case, the application may fuse
42700e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * multiple output frames together to a final frame for reprocessing. When N image are
42710e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * fused into 1 image for reprocessing, the exposure time increase factor could be up to
42720e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * square root of N (based on a simple photon shot noise model). The camera device will
42730e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * adjust the reprocessing noise reduction and edge enhancement parameters accordingly to
42740e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * produce the best quality images.</p>
42750e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * <p>This is relative factor, 1.0 indicates the application hasn't processed the input
42760e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * buffer in a way that affects its effective exposure time.</p>
42770e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * <p>This control is only effective for YUV reprocessing capture request. For noise
42780e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * reduction reprocessing, it is only effective when <code>{@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode} != OFF</code>.
42790e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * Similarly, for edge enhancement reprocessing, it is only effective when
42800e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * <code>{@link CaptureRequest#EDGE_MODE android.edge.mode} != OFF</code>.</p>
42810e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * <p><b>Units</b>: Relative exposure time increase factor.</p>
42820e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * <p><b>Range of valid values:</b><br>
42830e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * &gt;= 1.0</p>
42840e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
4285513f7c33eae0084ecd70062d660f2b873032d895Zhijun He     * <p><b>Limited capability</b> -
4286513f7c33eae0084ecd70062d660f2b873032d895Zhijun He     * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
4287513f7c33eae0084ecd70062d660f2b873032d895Zhijun He     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
42880e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     *
42890e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * @see CaptureRequest#EDGE_MODE
4290513f7c33eae0084ecd70062d660f2b873032d895Zhijun He     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
42910e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * @see CaptureRequest#NOISE_REDUCTION_MODE
42920e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
42930e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He     */
42940e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He    @PublicKey
42950e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He    public static final Key<Float> REPROCESS_EFFECTIVE_EXPOSURE_FACTOR =
42960e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He            new Key<Float>("android.reprocess.effectiveExposureFactor", float.class);
42970e99c2260d874eaeb62ddeb75c2f29f26818ad99Zhijun He
42985a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala    /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
42995a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     * End generated code
43005a32b20ccc34fd7d4f048de05c427a7a96786531Eino-Ville Talvala     *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
43016c76f58f31635c19c14ae161f96dad2082537860Igor Murashkin
43024b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin
43034b8cd6b44cf800cf5dd88e5afbcff4968398779dIgor Murashkin
4304b2675542c2f414154125b534767ae0903fba581eEino-Ville Talvala}
4305