1 /*
2  * Copyright 2023 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package androidx.camera.camera2.pipe.compat
18 
19 import android.hardware.camera2.CameraExtensionCharacteristics
20 import androidx.camera.camera2.pipe.Metadata
21 
22 public object CameraPipeKeys {
23 
24     /** Keys for sessionParameters when creating Extension sessions. */
25     public val camera2ExtensionMode: Metadata.Key<Int> =
26         Metadata.Key.create<Int>("androidx.camera.camera2.pipe.ExtensionMode")
27 
28     /** Key for configuring the tag for a Camera2 CaptureRequest. */
29     public val camera2CaptureRequestTag: Metadata.Key<Any> =
30         Metadata.Key.create<Any>("androidx.camera.camera2.pipe.CaptureRequestTag")
31 
32     /**
33      * Key for defaultParameters and requiredParameters that allows the users to ignore the required
34      * 3A parameters stipulated by the 3A controller in CameraPipe.
35      */
36     public val ignore3ARequiredParameters: Metadata.Key<Boolean> =
37         Metadata.Key.create<Boolean>("androidx.camera.camera2.pipe.Ignore3ARequiredParameters")
38 
39     /**
40      * [CAMERA2_EXTENSION_MODE_AUTOMATIC]: Automatic selection of particular extensions such as HDR
41      * or NIGHT depending on the current lighting and environment conditions. See
42      * [CameraExtensionCharacteristics.EXTENSION_AUTOMATIC]
43      */
44     public const val CAMERA2_EXTENSION_MODE_AUTOMATIC: Int = 0
45 
46     /**
47      * [CAMERA2_EXTENSION_MODE_FACE_RETOUCH]: Smooth skin and apply other cosmetic effects to faces.
48      * See [CameraExtensionCharacteristics.EXTENSION_FACE_RETOUCH]
49      */
50     public const val CAMERA2_EXTENSION_MODE_FACE_RETOUCH: Int = 1
51 
52     /**
53      * [CAMERA2_EXTENSION_MODE_BOKEH]: Blur certain regions of the final image thereby "enhancing"
54      * focus for all remaining non-blurred parts. See
55      * [CameraExtensionCharacteristics.EXTENSION_BOKEH]
56      */
57     public const val CAMERA2_EXTENSION_MODE_BOKEH: Int = 2
58 
59     /**
60      * [CAMERA2_EXTENSION_MODE_HDR]: Enhance the dynamic range of the final image. See
61      * [CameraExtensionCharacteristics.EXTENSION_HDR]
62      */
63     public const val CAMERA2_EXTENSION_MODE_HDR: Int = 3
64 
65     /**
66      * [CAMERA2_EXTENSION_MODE_NIGHT]: Suppress noise and improve the overall image quality under
67      * low light conditions. See [CameraExtensionCharacteristics.EXTENSION_NIGHT]
68      */
69     public const val CAMERA2_EXTENSION_MODE_NIGHT: Int = 4
70 }
71