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 CAMERA_PICTURE_ADAPTER_INTERFACE_H 17 #define CAMERA_PICTURE_ADAPTER_INTERFACE_H 18 19 #include "surface_buffer.h" 20 #include "picture_interface.h" 21 namespace OHOS::Media { 22 class Picture; 23 } 24 namespace OHOS { 25 namespace CameraStandard { 26 class PictureAdapter : public OHOS::CameraStandard::PictureIntf { 27 public: 28 PictureAdapter(); 29 ~PictureAdapter() override; 30 void Create(sptr<SurfaceBuffer> &surfaceBuffer) override; 31 void SetAuxiliaryPicture(sptr<SurfaceBuffer> &surfaceBuffer, 32 CameraAuxiliaryPictureType type) override; 33 void CreateWithDeepCopySurfaceBuffer(sptr<SurfaceBuffer> &surfaceBuffer) override; 34 bool Marshalling(Parcel &data) const override; 35 void UnmarshallingPicture(Parcel &data) override; 36 int32_t SetExifMetadata(sptr<SurfaceBuffer> &surfaceBuffer) override; 37 bool SetMaintenanceData(sptr<SurfaceBuffer> &surfaceBuffer) override; 38 void RotatePicture() override; 39 std::shared_ptr<Media::Picture> GetPicture() const; 40 private: 41 // Keep the order of members in this class, the bottom member will be destroyed first 42 std::shared_ptr<Media::Picture> picture_; 43 static constexpr uint8_t PIXEL_SIZE_HDR_YUV = 3; 44 static constexpr uint8_t HDR_PIXEL_SIZE = 2; 45 }; 46 } // namespace CameraStandard 47 } // namespace OHOS 48 49 #endif // CAMERA_PICTURE_ADAPTER_INTERFACE_H