• 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 OHIMAGEEFFECTNDK_PIXELMAP_HELPER_H
17 #define OHIMAGEEFFECTNDK_PIXELMAP_HELPER_H
18 
19 #include <multimedia/image_framework/image/pixelmap_native.h>
20 #include <multimedia/image_framework/image_pixel_map_mdk.h>
21 #include <memory>
22 
23 #include "napi/native_api.h"
24 
25 class PixelMapHelper {
26 public:
27     static std::shared_ptr<OH_PixelmapNative> Decode(std::string &pathName);
28     static bool Encode(OH_PixelmapNative *pixelmap, std::string &pathName);
29 
30     static std::shared_ptr<OH_PixelmapNative> ConvertPixelmap(NativePixelMap *nativePixelMap);
31     static napi_value ConvertPixelmap(OH_PixelmapNative *pixelmapNative, napi_env env);
32 };
33 
34 #endif //OHIMAGEEFFECTNDK_PIXELMAP_HELPER_H
35