1 /* 2 * Copyright (C) 2025 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 FRAMEWORKS_KITS_TAIHE_INCLUDE_PICTURE_TAIHE_H 17 #define FRAMEWORKS_KITS_TAIHE_INCLUDE_PICTURE_TAIHE_H 18 19 #include "ohos.multimedia.image.image.proj.hpp" 20 #include "ohos.multimedia.image.image.impl.hpp" 21 #include "picture.h" 22 #include "taihe/runtime.hpp" 23 24 namespace ANI::Image { 25 using namespace taihe; 26 using namespace ohos::multimedia::image::image; 27 28 class PictureImpl { 29 public: 30 PictureImpl(); 31 explicit PictureImpl(std::shared_ptr<OHOS::Media::Picture> picture); 32 ~PictureImpl(); 33 int64_t GetImplPtr(); 34 std::shared_ptr<OHOS::Media::Picture> GetNativePtr(); 35 36 PixelMap GetMainPixelmap(); 37 void Marshalling(uintptr_t sequence); 38 void Release(); 39 40 private: 41 std::shared_ptr<OHOS::Media::Picture> nativePicture_; 42 bool isRelease = false; 43 }; 44 } // namespace ANI::Image 45 46 #endif // FRAMEWORKS_KITS_TAIHE_INCLUDE_PICTURE_TAIHE_H