1 /* 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef OHOS_CAMERA_PORTRAIT_SESSION_H 17 #define OHOS_CAMERA_PORTRAIT_SESSION_H 18 19 #include <iostream> 20 #include <set> 21 #include <vector> 22 #include "camera_error_code.h" 23 #include "input/capture_input.h" 24 #include "output/capture_output.h" 25 #include "icamera_util.h" 26 #include "icapture_session.h" 27 #include "icapture_session_callback.h" 28 #include "capture_session.h" 29 30 namespace OHOS { 31 namespace CameraStandard { 32 class CaptureOutput; 33 class PortraitSession : public CaptureSession { 34 public: PortraitSession(sptr<ICaptureSession> & PortraitSession)35 explicit PortraitSession(sptr<ICaptureSession> &PortraitSession): CaptureSession(PortraitSession) {} 36 ~PortraitSession(); 37 38 /** 39 * @brief Get the supported portrait effects. 40 * 41 * @return Returns the array of portraiteffect. 42 */ 43 std::vector<PortraitEffect> GetSupportedPortraitEffects(); 44 45 /** 46 * @brief Get the portrait effects. 47 * 48 * @return Returns the array of portraiteffect. 49 */ 50 PortraitEffect GetPortraitEffect(); 51 52 /** 53 * @brief Set the portrait effects. 54 */ 55 void SetPortraitEffect(PortraitEffect effect); 56 57 /** 58 * @brief Determine if the given Ouput can be added to session. 59 * 60 * @param CaptureOutput to be added to session. 61 */ 62 bool CanAddOutput(sptr<CaptureOutput>& output) override; 63 private: 64 static const std::unordered_map<PortraitEffect, camera_portrait_effect_type_t> fwToMetaPortraitEffect_; 65 }; 66 } // namespace CameraStandard 67 } // namespace OHOS 68 #endif // OHOS_CAMERA_PORTRAIT_SESSION_H 69