• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 IMAGE_PROCESSING_INTERFACE_H
17 #define IMAGE_PROCESSING_INTERFACE_H
18 
19 #include "image_processing_types.h"
20 #include "algorithm_common.h"
21 
22 namespace OHOS {
23 namespace Media {
24 namespace VideoProcessingEngine {
25 class IImageProcessingNative {
26 public:
27     virtual ImageProcessing_ErrorCode Initialize() = 0;
28     virtual ImageProcessing_ErrorCode Deinitialize() = 0;
29     virtual ImageProcessing_ErrorCode SetParameter(const OH_AVFormat* parameter) = 0;
30     virtual ImageProcessing_ErrorCode GetParameter(OH_AVFormat* parameter) = 0;
31     virtual ImageProcessing_ErrorCode Process(OH_PixelmapNative* sourceImage,
32         OH_PixelmapNative* destinationImage) = 0;
33     virtual ImageProcessing_ErrorCode ConvertColorSpace(OH_PixelmapNative* sourceImage,
34         OH_PixelmapNative* destinationImage) = 0;
35     virtual ImageProcessing_ErrorCode Compose(OH_PixelmapNative* sourceImage, OH_PixelmapNative* sourceGainmap,
36         OH_PixelmapNative* destinationImage) = 0;
37     virtual ImageProcessing_ErrorCode Decompose(OH_PixelmapNative* sourceImage, OH_PixelmapNative* destinationImage,
38         OH_PixelmapNative* destinationGainmap) = 0;
39     virtual ImageProcessing_ErrorCode GenerateMetadata(OH_PixelmapNative* sourceImage) = 0;
40     virtual ImageProcessing_ErrorCode EnhanceDetail(OH_PixelmapNative* sourceImage,
41         OH_PixelmapNative* destinationImage) = 0;
42 
43 protected:
44     IImageProcessingNative() = default;
45     virtual ~IImageProcessingNative() = default;
46     IImageProcessingNative(const IImageProcessingNative&) = delete;
47     IImageProcessingNative& operator=(const IImageProcessingNative&) = delete;
48     IImageProcessingNative(IImageProcessingNative&&) = delete;
49     IImageProcessingNative& operator=(IImageProcessingNative&&) = delete;
50 
51 public:
52     ClContext *opengclContext_ {nullptr};
53     std::shared_ptr<OpenGLContext> openglContext_ {nullptr};
54 };
55 } // namespace VideoProcessingEngine
56 } // namespace Media
57 } // namespace OHOS
58 
59 #endif // IMAGE_PROCESSING_INTERFACE_H