1 /* 2 * Copyright (c) 2024 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 INTERFACES_INNER_API_AIHDR_ENHANCER_H 17 #define INTERFACES_INNER_API_AIHDR_ENHANCER_H 18 19 #include <atomic> 20 #include <memory> 21 #include <optional> 22 23 #include "external_window.h" 24 25 #include "algorithm_common.h" 26 27 namespace OHOS { 28 namespace Media { 29 namespace VideoProcessingEngine { 30 class __attribute__((visibility("default"))) AihdrEnhancer { 31 public: 32 /* * 33 * @brief Create a AihdrEnhancer object. 34 * @syscap 35 * @return pointer of the AihdrEnhancer object. 36 * @since 14 37 */ 38 static std::shared_ptr<AihdrEnhancer> Create(); 39 40 /* * 41 * @brief 设置参数 42 * @syscap 43 * @param parameter 输入参数 44 * @return 返回错误码VPEAlgoErrCode 45 * @since 14 46 */ 47 virtual VPEAlgoErrCode SetParameter(const int& parameter) = 0; 48 49 /* * 50 * @brief 查询参数 51 * @syscap 52 * @param parameter 输出参数 53 * @return 返回错误码VPEAlgoErrCode 54 * @since 14 55 */ 56 virtual VPEAlgoErrCode GetParameter(int& parameter) const = 0; 57 58 /* * 59 * @brief 用于解码后sdr视频帧生成128位lut曲线。 60 * @syscap 61 * @param input 输入图片,生成的lut曲线写入该image 62 * @return 返回错误码VPEAlgoErrCode 63 * @since 14 64 */ 65 virtual VPEAlgoErrCode Process(const sptr<SurfaceBuffer>& input) = 0; 66 67 protected: 68 virtual ~AihdrEnhancer() = default; 69 }; 70 71 extern "C" int32_t AihdrEnhancerCreate(int32_t* instance); 72 73 extern "C" int32_t AihdrEnhancerProcessImage(int32_t instance, OHNativeWindowBuffer* inputImage); 74 75 extern "C" int32_t AihdrEnhancerDestroy(int32_t* instance); 76 77 } // namespace VideoProcessingEngine 78 } // namespace Media 79 } // namespace OHOS 80 81 #endif // INTERFACES_INNER_API_AIHDR_ENHANCER_H 82