1 /*
2  * Copyright 2024 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.extensions;
18 
19 import androidx.annotation.IntRange;
20 import androidx.camera.core.CameraControl;
21 
22 /**
23  * A camera extensions control instance that allows customization of capture request settings for
24  * supported camera extensions.
25  *
26  * <p>Applications can leverage the
27  * {@link ExtensionsManager#getCameraExtensionsControl(CameraControl)} method to acquire a
28  * CameraExtensionsControl object to manage extension-related settings.
29  */
30 public interface CameraExtensionsControl {
31     /**
32      * Sets the extension strength for the extension mode associated with the
33      * CameraExtensionsControl.
34      *
35      * <p>Strength equal to 0 means that the extension must not apply any post-processing and
36      * return a regular captured frame. Strength equal to 100 is the default level of
37      * post-processing applied when the control is not supported or not set by the client. Values
38      * between 0 and 100 will have different effect depending on the extension type as described
39      * below:
40      * <ul>
41      *     <li>{@link ExtensionMode#BOKEH} - the strength will control the amount of blur.
42      *     <li>{@link ExtensionMode#HDR} and {@link ExtensionMode#NIGHT} - the strength will
43      *     control the amount of images fused and the brightness of the final image.
44      *     <li>{@link ExtensionMode#FACE_RETOUCH} - the strength value will control the amount of
45      *     cosmetic enhancement and skin smoothing.
46      * </ul>
47      *
48      * <p>This will be supported if the
49      * {@link CameraExtensionsInfo#isExtensionStrengthAvailable()} associated to the same
50      * extensions enabled camera returns {@code true}. Invoking this method will be no-op if
51      * extension strength is not supported.
52      *
53      * @param strength the new extension strength value
54      */
setExtensionStrength(@ntRangefrom = 0, to = 100) int strength)55     default void setExtensionStrength(@IntRange(from = 0, to = 100) int strength){
56     }
57 }
58