14d949f91Sopenharmony_ci/* 24d949f91Sopenharmony_ci * Copyright (C) 2024 Huawei Device Co., Ltd. 34d949f91Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 44d949f91Sopenharmony_ci * you may not use this file except in compliance with the License. 54d949f91Sopenharmony_ci * You may obtain a copy of the License at 64d949f91Sopenharmony_ci * 74d949f91Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 84d949f91Sopenharmony_ci * 94d949f91Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 104d949f91Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 114d949f91Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 124d949f91Sopenharmony_ci * See the License for the specific language governing permissions and 134d949f91Sopenharmony_ci * limitations under the License. 144d949f91Sopenharmony_ci */ 154d949f91Sopenharmony_ci 164d949f91Sopenharmony_ci#include "mock_picture.h" 174d949f91Sopenharmony_ci#include "exif_metadata.h" 184d949f91Sopenharmony_ci#include "surface_buffer.h" 194d949f91Sopenharmony_ci 204d949f91Sopenharmony_cinamespace OHOS { 214d949f91Sopenharmony_cinamespace Media { 224d949f91Sopenharmony_cinamespace Effect { 234d949f91Sopenharmony_ciconstexpr uint32_t HALF = 2; 244d949f91Sopenharmony_ciconst std::string IMAGE_LENGTH = "ImageLength"; 254d949f91Sopenharmony_ciconst std::string IMAGE_WIDTH = "ImageWidth"; 264d949f91Sopenharmony_ci 274d949f91Sopenharmony_ciMockPicture::MockPicture() 284d949f91Sopenharmony_ci{ 294d949f91Sopenharmony_ci mainPixelMap_ = std::make_shared<MockPixelMap>(); 304d949f91Sopenharmony_ci 314d949f91Sopenharmony_ci mockGainmapPixelMap_ = 324d949f91Sopenharmony_ci std::make_shared<MockPixelMap>(mainPixelMap_->GetWidth() / HALF, mainPixelMap_->GetHeight() / HALF); 334d949f91Sopenharmony_ci mockGainmapAuxiliaryPicture_ = std::make_shared<AuxiliaryPicture>(); 344d949f91Sopenharmony_ci mockGainmapAuxiliaryPicture_->content_ = mockGainmapPixelMap_; 354d949f91Sopenharmony_ci auxiliaryPictures_.emplace(AuxiliaryPictureType::GAINMAP, mockGainmapAuxiliaryPicture_); 364d949f91Sopenharmony_ci 374d949f91Sopenharmony_ci exifMetadata_ = std::make_shared<ExifMetadata>(); 384d949f91Sopenharmony_ci exifMetadata_->SetValue(IMAGE_LENGTH, std::to_string(mainPixelMap_->GetHeight())); 394d949f91Sopenharmony_ci exifMetadata_->SetValue(IMAGE_WIDTH, std::to_string(mainPixelMap_->GetWidth())); 404d949f91Sopenharmony_ci} 414d949f91Sopenharmony_ci} // namespace Effect 424d949f91Sopenharmony_ci} // namespace Media 434d949f91Sopenharmony_ci} // namespace OHOS