/* * Copyright (C) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef INTERFACES_INNERKITS_INCLUDE_PICTURE_H #define INTERFACES_INNERKITS_INCLUDE_PICTURE_H #include "pixel_map.h" #include "auxiliary_picture.h" #include "image_type.h" #include namespace OHOS { class SurfaceBuffer; } namespace OHOS { namespace Media { class ExifMetadata; class Picture : public Parcelable { public: virtual ~Picture(); NATIVEEXPORT static std::unique_ptr Create(std::shared_ptr &PixelMap); NATIVEEXPORT static std::unique_ptr Create(sptr &surfaceBuffer); NATIVEEXPORT static std::unique_ptr SurfaceBuffer2PixelMap(sptr &surfaceBuffer); NATIVEEXPORT std::shared_ptr GetMainPixel(); NATIVEEXPORT void SetMainPixel(std::shared_ptr PixelMap); NATIVEEXPORT std::unique_ptr GetHdrComposedPixelMap(); NATIVEEXPORT std::shared_ptr GetGainmapPixelMap(); NATIVEEXPORT std::shared_ptr GetAuxiliaryPicture(AuxiliaryPictureType type); NATIVEEXPORT void SetAuxiliaryPicture(std::shared_ptr &picture); NATIVEEXPORT bool HasAuxiliaryPicture(AuxiliaryPictureType type); NATIVEEXPORT virtual bool Marshalling(Parcel &data) const override; NATIVEEXPORT static Picture *Unmarshalling(Parcel &data); NATIVEEXPORT static Picture *Unmarshalling(Parcel &data, PICTURE_ERR &error); NATIVEEXPORT int32_t SetExifMetadata(sptr &surfaceBuffer); NATIVEEXPORT int32_t SetExifMetadata(std::shared_ptr exifMetadata); NATIVEEXPORT std::shared_ptr GetExifMetadata(); NATIVEEXPORT bool SetMaintenanceData(sptr &surfaceBuffer); NATIVEEXPORT sptr GetMaintenanceData() const; private: std::shared_ptr mainPixelMap_; std::map> auxiliaryPictures_; sptr maintenanceData_; std::shared_ptr exifMetadata_ = nullptr; }; } } #endif //INTERFACES_INNERKITS_INCLUDE_PICTURE_H_