1 /* 2 * Copyright (c) 2022-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 #include "core/components_ng/image_provider/image_object.h" 17 18 #include "core/components/common/layout/constants.h" 19 20 namespace OHOS::Ace::NG { GetImageSize() const21const SizeF& ImageObject::GetImageSize() const 22 { 23 return imageSize_; 24 } 25 SetImageSize(const SizeF & imageSize)26void ImageObject::SetImageSize(const SizeF& imageSize) 27 { 28 imageSize_ = imageSize; 29 } 30 GetSourceInfo() const31const ImageSourceInfo& ImageObject::GetSourceInfo() const 32 { 33 return src_; 34 } 35 GetData() const36const RefPtr<ImageData>& ImageObject::GetData() const 37 { 38 return data_; 39 } 40 SetData(const RefPtr<ImageData> & data)41void ImageObject::SetData(const RefPtr<ImageData>& data) 42 { 43 data_ = data; 44 } 45 ClearData()46void ImageObject::ClearData() 47 { 48 data_ = nullptr; 49 } 50 GetFrameCount() const51int32_t ImageObject::GetFrameCount() const 52 { 53 return frameCount_; 54 } 55 SetFrameCount(int32_t frameCount)56void ImageObject::SetFrameCount(int32_t frameCount) 57 { 58 frameCount_ = frameCount; 59 } 60 SetOrientation(ImageRotateOrientation orientation)61void ImageObject::SetOrientation(ImageRotateOrientation orientation) 62 { 63 orientation_ = orientation; 64 } 65 GetOrientation() const66ImageRotateOrientation ImageObject::GetOrientation() const 67 { 68 return orientation_; 69 } 70 SetUserOrientation(ImageRotateOrientation orientation)71void ImageObject::SetUserOrientation(ImageRotateOrientation orientation) 72 { 73 userOrientation_ = orientation; 74 } 75 GetUserOrientation() const76ImageRotateOrientation ImageObject::GetUserOrientation() const 77 { 78 return userOrientation_; 79 } 80 } // namespace OHOS::Ace::NG 81