• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifndef FOUNDATION_ACE_INTERFACE_DRAWABLE_DESCRIPTOR_PIXELMAP_DRAWABLE_DESCRIPTOR_H
16 #define FOUNDATION_ACE_INTERFACE_DRAWABLE_DESCRIPTOR_PIXELMAP_DRAWABLE_DESCRIPTOR_H
17 
18 #include <cstdint>
19 #include <memory>
20 
21 #include "base/image_data.h"
22 #include "base/marcos.h"
23 #include "base/pixel_map.h"
24 #include "core/drawable_descriptor_base.h"
25 
26 namespace OHOS {
27 namespace Ace {
28 namespace Drawable {
29 class DRAWABLE_FORCE_EXPORT PixelmapDrawableDescriptor : public DrawableDescriptor {
30 public:
31     PixelmapDrawableDescriptor() = default;
32 
33     ~PixelmapDrawableDescriptor() override = default;
34 
35     std::shared_ptr<Media::PixelMap> GetPixelMap() override;
36 
37     void SetPixelMap(const std::shared_ptr<Media::PixelMap>& pixelMap) override;
38 
39     int32_t GetOriginalWidth() const override;
40 
41     int32_t GetOriginalHeight() const override;
42 
43     DrawableType GetDrawableType() const override;
44 
45     DrawableInfo FetchSync() override;
46 
47     void Fetch() override;
48 
49     void RegisterRedrawCallback(RedrawCallback&& callback) override;
50 
51     void Draw(RSCanvas& canvas, PaintConfig config) override;
52 
53     void Validate() override;
54 
55     void LoadImageData() override;
56 
57     void Decode() override;
58 
59 protected:
60     std::shared_ptr<PixelMap> pixelMap_;
61 };
62 } // namespace Drawable
63 } // namespace Ace
64 } // namespace OHOS
65 
66 #endif // FOUNDATION_ACE_INTERFACE_DRAWABLE_DESCRIPTOR_PIXELMAP_DRAWABLE_DESCRIPTOR_H
67