• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022-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 FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERNS_IMAGE_IMAGE_PATTERN_H
17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERNS_IMAGE_IMAGE_PATTERN_H
18 
19 #include <memory>
20 
21 #include "interfaces/inner_api/ace/ai/image_analyzer.h"
22 
23 #include "base/geometry/offset.h"
24 #include "base/image/drawable_descriptor.h"
25 #include "base/image/image_defines.h"
26 #include "base/image/pixel_map.h"
27 #include "base/memory/referenced.h"
28 #include "core/animation/picture_animation.h"
29 #include "core/components/common/layout/constants.h"
30 #include "core/common/clipboard/clipboard.h"
31 #include "core/components_ng/event/click_event.h"
32 #include "core/components_ng/manager/select_overlay/select_overlay_client.h"
33 #include "core/components_ng/manager/select_overlay/selection_host.h"
34 #include "core/components_ng/pattern/image/image_content_modifier.h"
35 #include "core/components_ng/pattern/image/image_dfx.h"
36 #include "core/components_ng/pattern/image/image_event_hub.h"
37 #include "core/components_ng/pattern/image/image_layout_algorithm.h"
38 #include "core/components_ng/pattern/image/image_layout_property.h"
39 #include "core/components_ng/pattern/image/image_overlay_modifier.h"
40 #include "core/components_ng/pattern/image/image_render_property.h"
41 #include "core/components_ng/pattern/image/image_properties.h"
42 #include "core/components_ng/pattern/pattern.h"
43 #include "core/components_ng/render/canvas_image.h"
44 #include "core/image/image_source_info.h"
45 
46 namespace OHOS::Ace {
47 class ImageAnalyzerManager;
48 }
49 
50 namespace OHOS::Ace::NG {
51 class InspectorFilter;
52 
53 class ACE_FORCE_EXPORT ImagePattern : public Pattern, public SelectOverlayClient {
54     DECLARE_ACE_TYPE(ImagePattern, Pattern, SelectionHost);
55 
56 public:
57     using OnProgressCallback = std::function<void(const uint32_t& dlNow, const uint32_t& dlTotal)>;
58 
59     ImagePattern();
60     ~ImagePattern() override;
61 
GetContextParam()62     std::optional<RenderContext::ContextParam> GetContextParam() const override
63     {
64         return RenderContext::ContextParam { .type = RenderContext::ContextType::CANVAS, .surfaceName = std::nullopt };
65     }
66 
67     RefPtr<NodePaintMethod> CreateNodePaintMethod() override;
68 
CreateLayoutProperty()69     RefPtr<LayoutProperty> CreateLayoutProperty() override
70     {
71         return MakeRefPtr<ImageLayoutProperty>();
72     }
73 
CreatePaintProperty()74     RefPtr<PaintProperty> CreatePaintProperty() override
75     {
76         return MakeRefPtr<ImageRenderProperty>();
77     }
78 
CreateLayoutAlgorithm()79     RefPtr<LayoutAlgorithm> CreateLayoutAlgorithm() override
80     {
81         return MakeRefPtr<ImageLayoutAlgorithm>();
82     }
83 
CreateEventHub()84     RefPtr<EventHub> CreateEventHub() override
85     {
86         return MakeRefPtr<ImageEventHub>();
87     }
88 
89     // Called on main thread to check if need rerender of the content.
90     bool OnDirtyLayoutWrapperSwap(const RefPtr<LayoutWrapper>& dirty, const DirtySwapConfig& config) override;
91 
92     FocusPattern GetFocusPattern() const override;
93 
GetCanvasImage()94     const RefPtr<CanvasImage>& GetCanvasImage()
95     {
96         return image_;
97     }
98 
GetAltCanvasImage()99     const RefPtr<CanvasImage>& GetAltCanvasImage()
100     {
101         return altImage_;
102     }
103 
GetClientHost()104     RefPtr<FrameNode> GetClientHost() const override
105     {
106         return GetHost();
107     }
108 
109     void CreateModifier();
110     void CreateObscuredImage();
111     void LoadImageDataIfNeed();
112     bool RecycleImageData();
113     void OnNotifyMemoryLevel(int32_t level) override;
114     void OnWindowHide() override;
115     void OnWindowShow() override;
116     void OnVisibleChange(bool isVisible) override;
117     void OnRecycle() override;
118     void OnReuse() override;
119 
120     void OnAreaChangedInner() override;
121     void RemoveAreaChangeInner();
122     void CalAndUpdateSelectOverlay();
123     OffsetF GetParentGlobalOffset() const;
124     void CheckHandles(SelectHandleInfo& handleInfo);
125 
126     void EnableDrag();
127     bool BetweenSelectedPosition(const Offset& globalOffset) override;
128 
DefaultSupportDrag()129     bool DefaultSupportDrag() override
130     {
131         return true;
132     }
133 
SetImageQuality(AIImageQuality imageQuality)134     void SetImageQuality(AIImageQuality imageQuality)
135     {
136         isImageReloadNeeded_ = isImageReloadNeeded_ | (imageQuality_ != imageQuality);
137         imageQuality_ = imageQuality;
138     }
139 
SetOrientation(ImageRotateOrientation orientation)140     void SetOrientation(ImageRotateOrientation orientation)
141     {
142         isOrientationChange_ = (userOrientation_ != orientation);
143         userOrientation_ = orientation;
144     }
145 
GetOrientation()146     ImageRotateOrientation GetOrientation()
147     {
148         return userOrientation_;
149     }
150 
151     void UpdateOrientation();
152 
GetImageQuality()153     AIImageQuality GetImageQuality()
154     {
155         return imageQuality_;
156     }
157 
SetCopyOption(CopyOptions value)158     void SetCopyOption(CopyOptions value)
159     {
160         copyOption_ = value;
161     }
162 
163     std::string GetImageFitStr(ImageFit value);
164 
165     std::string GetImageRepeatStr(ImageRepeat value);
166 
167     std::string GetImageColorFilterStr(const std::vector<float>& colorFilter);
168 
SetSyncLoad(bool value)169     void SetSyncLoad(bool value)
170     {
171         syncLoad_ = value;
172     }
173 
GetSyncLoad()174     bool GetSyncLoad() const
175     {
176         return syncLoad_;
177     }
178 
SetNeedBorderRadius(bool needBorderRadius)179     void SetNeedBorderRadius(bool needBorderRadius)
180     {
181         needBorderRadius_ = needBorderRadius;
182     }
183 
184     void SetImageAnalyzerConfig(const ImageAnalyzerConfig& config);
185     void SetImageAnalyzerConfig(void* config);
186     void SetImageAIOptions(void* options);
187     void BeforeCreatePaintWrapper() override;
188     void DumpInfo() override;
189     void DumpInfo(std::unique_ptr<JsonValue>& json) override;
190     void DumpSimplifyInfo(std::unique_ptr<JsonValue>& json) override;
191     void DumpLayoutInfo();
192     void DumpImageSourceInfo(const RefPtr<OHOS::Ace::NG::ImageLayoutProperty>& layoutProp);
193     inline void DumpAltSourceInfo(const RefPtr<OHOS::Ace::NG::ImageLayoutProperty>& layoutProp);
194     inline void DumpImageFit(const RefPtr<OHOS::Ace::NG::ImageLayoutProperty>& layoutProp);
195     inline void DumpFitOriginalSize(const RefPtr<OHOS::Ace::NG::ImageLayoutProperty>& layoutProp);
196     inline void DumpSourceSize(const RefPtr<OHOS::Ace::NG::ImageLayoutProperty>& layoutProp);
197     inline void DumpAutoResize(const RefPtr<OHOS::Ace::NG::ImageLayoutProperty>& layoutProp);
198     void DumpLayoutInfo(std::unique_ptr<JsonValue>& json);
199     void DumpRenderInfo();
200     inline void DumpRenderMode(const RefPtr<OHOS::Ace::NG::ImageRenderProperty>& renderProp);
201     inline void DumpImageRepeat(const RefPtr<OHOS::Ace::NG::ImageRenderProperty>& renderProp);
202     inline void DumpImageColorFilter(const RefPtr<OHOS::Ace::NG::ImageRenderProperty>& renderProp);
203     inline void DumpFillColor(const RefPtr<OHOS::Ace::NG::ImageRenderProperty>& renderProp);
204     inline void DumpDynamicRangeMode(const RefPtr<OHOS::Ace::NG::ImageRenderProperty>& renderProp);
205     inline void DumpMatchTextDirection(const RefPtr<OHOS::Ace::NG::ImageRenderProperty>& renderProp);
206     inline void DumpSmoothEdge(const RefPtr<OHOS::Ace::NG::ImageRenderProperty>& renderProp);
207     inline void DumpResizable(const RefPtr<OHOS::Ace::NG::ImageRenderProperty>& renderProp);
208     inline void DumpInterpolation(const RefPtr<OHOS::Ace::NG::ImageRenderProperty>& renderProp);
209     void DumpBorderRadiusProperties(const RefPtr<OHOS::Ace::NG::ImageRenderProperty>& renderProp);
210     inline void DumpOtherInfo();
211     void DumpRenderInfo(std::unique_ptr<JsonValue>& json);
212     void DumpAdvanceInfo() override;
213     void DumpAdvanceInfo(std::unique_ptr<JsonValue>& json) override;
214     void DumpSvgInfo();
GetImageLoadingContext()215     WeakPtr<ImageLoadingContext> GetImageLoadingContext()
216     {
217         return WeakClaim(AceType::RawPtr(loadingCtx_));
218     }
219 
GetAltImageLoadingContext()220     WeakPtr<ImageLoadingContext> GetAltImageLoadingContext()
221     {
222         return WeakClaim(AceType::RawPtr(altLoadingCtx_));
223     }
224     void EnableAnalyzer(bool value);
225     bool hasSceneChanged();
226     void OnSensitiveStyleChange(bool isSensitive) override;
227 
228     // animation
229     struct CacheImageStruct {
230         CacheImageStruct() = default;
CacheImageStructCacheImageStruct231         CacheImageStruct(const RefPtr<FrameNode>& imageNode) : imageNode(imageNode) {}
232         virtual ~CacheImageStruct() = default;
233         RefPtr<FrameNode> imageNode;
234         int32_t index = 0;
235         bool isLoaded = false;
236     };
237 
238     void ImageAnimatorPattern();
SetImages(std::vector<ImageProperties> && images)239     void SetImages(std::vector<ImageProperties>&& images)
240     {
241         CHECK_NULL_VOID(images.size());
242         images_ = std::move(images);
243         durationTotal_ = 0;
244         for (const auto& childImage : images_) {
245             if ((!childImage.src.empty() || childImage.pixelMap != nullptr) && childImage.duration > 0) {
246                 durationTotal_ += childImage.duration;
247             }
248         }
249         imagesChangedFlag_ = true;
250         RegisterVisibleAreaChange();
251     }
252 
ResetImages()253     void ResetImages()
254     {
255         images_.clear();
256     }
257     void ResetImage();
258     void ResetAltImage();
259     void ResetImageProperties();
260 
261     void ResetImageAndAlt();
262 
263     void ResetPictureSize();
264 
GetHasSizeChanged()265     bool GetHasSizeChanged()
266     {
267         return hasSizeChanged;
268     }
269 
StartAnimation()270     void StartAnimation()
271     {
272         status_ = Animator::Status::RUNNING;
273     }
274 
StopAnimation()275     void StopAnimation()
276     {
277         status_ = Animator::Status::STOPPED;
278         OnAnimatedModifyDone();
279     }
280 
SetImageType(ImageType imageType)281     void SetImageType(ImageType imageType)
282     {
283         imageType_ = imageType;
284     }
285 
GetImageType()286     ImageType GetImageType()
287     {
288         return imageType_;
289     }
290 
GetIsAnimation()291     bool GetIsAnimation() const
292     {
293         return imageType_ == ImageType::ANIMATED_DRAWABLE;
294     }
295 
IsAtomicNode()296     bool IsAtomicNode() const override
297     {
298         return true;
299     }
300 
301     bool AllowVisibleAreaCheck() const override;
302 
OnInActive()303     void OnInActive() override
304     {
305         if (status_ == Animator::Status::RUNNING) {
306             animator_->Pause();
307         }
308     }
309 
310     void OnActive() override;
311 
312     void SetDuration(int32_t duration);
313     void SetIteration(int32_t iteration);
314 
SetSrcUndefined(bool isUndefined)315     void SetSrcUndefined(bool isUndefined)
316     {
317         isSrcUndefined_ = isUndefined;
318     }
319 
SetImageAnimator(bool isImageAnimator)320     void SetImageAnimator(bool isImageAnimator)
321     {
322         isImageAnimator_ = isImageAnimator;
323     }
324 
GetNeedLoadAlt()325     bool GetNeedLoadAlt()
326     {
327         return needLoadAlt_;
328     }
329 
SetNeedLoadAlt(bool needLoadAlt)330     void SetNeedLoadAlt(bool needLoadAlt)
331     {
332         needLoadAlt_ = needLoadAlt;
333     }
334 
335     void SetOnProgressCallback(std::function<void(const uint32_t& dlNow, const uint32_t& dlTotal)>&& onProgress);
336 
GetRawImageSize()337     SizeF GetRawImageSize()
338     {
339         if (!loadingCtx_) {
340             return SizeF(-1.0, -1.0);
341         }
342         return loadingCtx_->GetImageSize();
343     }
344 
345     void OnVisibleAreaChange(bool visible = true, double ratio = 0.0);
346 
GetDefaultAutoResize()347     bool GetDefaultAutoResize()
348     {
349         return autoResizeDefault_;
350     }
351 
GetDefaultInterpolation()352     ImageInterpolation GetDefaultInterpolation()
353     {
354         return interpolationDefault_;
355     }
356     void InitOnKeyEvent();
357 
SetIsComponentSnapshotNode(bool isComponentSnapshotNode)358     void SetIsComponentSnapshotNode(bool isComponentSnapshotNode)
359     {
360         isComponentSnapshotNode_ = isComponentSnapshotNode;
361     }
362 
SetRenderedImageInfo(const RenderedImageInfo & renderedImageInfo)363     void SetRenderedImageInfo(const RenderedImageInfo& renderedImageInfo)
364     {
365         renderedImageInfo_ = renderedImageInfo;
366     }
367 
368     // Sets the decoding format for the external domain.
369     // Note: Only NV21, RGBA_8888, RGBA_1010102, YCBCR_P010, YCRCB_P010 format is supported at this time.
370     void SetExternalDecodeFormat(PixelFormat externalDecodeFormat);
371 
GetExternalDecodeFormat()372     PixelFormat GetExternalDecodeFormat()
373     {
374         return externalDecodeFormat_;
375     }
376     void AddPixelMapToUiManager();
377 
SetDrawable(const RefPtr<DrawableDescriptor> & drawable)378     void SetDrawable(const RefPtr<DrawableDescriptor>& drawable)
379     {
380         drawable_ = drawable;
381     }
382 
383     // this method for measure content
384     std::optional<SizeF> GetImageSizeForMeasure();
385 
386     // this method for on complete callback execute after measuring
387     void FinishMeasureForOnComplete();
388 
389     void DrawDrawable(RSCanvas& canvas);
390 
391 protected:
392     void RegisterWindowStateChangedCallback();
393     void UnregisterWindowStateChangedCallback();
394     bool isShow_ = true;
395     RefPtr<ImageOverlayModifier> overlayMod_;
396     RefPtr<ImageContentModifier> contentMod_;
397 
398 private:
399     class ObscuredImage : public CanvasImage {
DrawToRSCanvas(RSCanvas & canvas,const RSRect & srcRect,const RSRect & dstRect,const BorderRadiusArray & radiusXY)400         void DrawToRSCanvas(
401             RSCanvas& canvas, const RSRect& srcRect, const RSRect& dstRect, const BorderRadiusArray& radiusXY) override
402         {}
DrawRect(RSCanvas & canvas,const RSRect & srcRect,const RSRect & dstRect)403         void DrawRect(RSCanvas& canvas, const RSRect& srcRect, const RSRect& dstRect) override {}
GetWidth()404         int32_t GetWidth() const override
405         {
406             return 0;
407         }
GetHeight()408         int32_t GetHeight() const override
409         {
410             return 0;
411         }
412     };
413 
414     void OnAttachToFrameNode() override;
415     void OnDetachFromFrameNode(FrameNode* frameNode) override;
416     void OnDetachFromMainTree() override;
417 
418     void OnModifyDone() override;
419     void OnPixelMapDrawableModifyDone();
420     ImagePaintConfig CreatePaintConfig();
421     void Validate();
422     void RegisterDrawableRedrawCallback();
423     void UpdateGestureAndDragWhenModify();
424     bool CheckImagePrivacyForCopyOption();
425     void UpdateOffsetForImageAnalyzerOverlay();
426     void SetFrameOffsetForOverlayNode();
427 
428     void OnLanguageConfigurationUpdate() override;
429 
430     /**
431      * @brief Start decoding image after ImageData is ready and dstSize is determined.
432      *
433      * @param dstSize The size of the image to be decoded.
434      */
435     void StartDecoding(const SizeF& dstSize);
436     bool CheckIfNeedLayout();
437     void OnImageDataReady();
438     void OnCompleteInDataReady();
439     void OnImageLoadFail(const std::string& errorMsg);
440     void OnImageLoadSuccess();
441     void ApplyAIModificationsToImage();
442     void SetImagePaintConfig(const RefPtr<CanvasImage>& canvasImage, const RectF& srcRect, const RectF& dstRect,
443         const ImageSourceInfo& sourceInfo, int32_t frameCount = 1);
444     void UpdateInternalResource(ImageSourceInfo& sourceInfo);
445 
446     void PrepareAnimation(const RefPtr<CanvasImage>& image);
447     void SetRedrawCallback(const RefPtr<CanvasImage>& image);
448     void SetOnFinishCallback(const RefPtr<CanvasImage>& image);
449     void RegisterVisibleAreaChange(bool isCalcClip = true);
450     void TriggerVisibleAreaChangeForChild(const RefPtr<UINode>& node, bool visible, double ratio);
451 
452     void InitCopy();
453     void HandleCopy();
454     void OpenSelectOverlay();
455     void CloseSelectOverlay();
456 
457     void TriggerFirstVisibleAreaChange();
458 
459     void UpdateDragEvent(const RefPtr<OHOS::Ace::DragEvent>& event);
460 
461     void ToJsonValue(std::unique_ptr<JsonValue>& json, const InspectorFilter& filter) const override;
462 
463     RectF CalcImageContentPaintSize(const RefPtr<GeometryNode>& geometryNode);
464 
465     DataReadyNotifyTask CreateDataReadyCallback();
466     LoadSuccessNotifyTask CreateLoadSuccessCallback();
467     LoadFailNotifyTask CreateLoadFailCallback();
468     OnCompleteInDataReadyNotifyTask CreateCompleteCallBackInDataReady();
469 
470     DataReadyNotifyTask CreateDataReadyCallbackForAlt();
471     LoadSuccessNotifyTask CreateLoadSuccessCallbackForAlt();
472     LoadFailNotifyTask CreateLoadFailCallbackForAlt();
473 
474     void OnColorConfigurationUpdate() override;
475     void OnDirectionConfigurationUpdate() override;
476     void OnIconConfigurationUpdate() override;
477     void OnConfigurationUpdate();
478     void LoadImage(const ImageSourceInfo& src, const PropertyChangeFlag& propertyChangeFlag, VisibleType visibleType);
479     void LoadAltImage(const ImageSourceInfo& altImageSourceInfo);
480 
481     void CreateAnalyzerOverlay();
482     void UpdateAnalyzerOverlay();
483     void UpdateAnalyzerOverlayLayout();
484     void UpdateAnalyzerUIConfig(const RefPtr<NG::GeometryNode>& geometryNode);
485     void DestroyAnalyzerOverlay();
486     void ReleaseImageAnalyzer();
487     bool IsSupportImageAnalyzerFeature();
488     void InitDefaultValue();
489     void ClearAltData();
490     void UpdateSvgSmoothEdgeValue();
491 
492     // animation
493     RefPtr<PictureAnimation<int32_t>> CreatePictureAnimation(int32_t size);
494     void AdaptSelfSize();
495     void SetShowingIndex(int32_t index);
496     void UpdateShowingImageInfo(const RefPtr<FrameNode>& imageFrameNode, int32_t index);
497     void UpdateCacheImageInfo(CacheImageStruct& cacheImage, int32_t index);
498     std::list<CacheImageStruct>::iterator FindCacheImageNode(const RefPtr<PixelMap>& src);
499     int32_t GetNextIndex(int32_t preIndex);
500     void GenerateCachedImages();
501     void AddImageLoadSuccessEvent(const RefPtr<FrameNode>& imageFrameNode);
502     static bool IsShowingSrc(const RefPtr<FrameNode>& imageFrameNode, const RefPtr<PixelMap>& src);
503     bool IsFormRender();
504     void UpdateFormDurationByRemainder();
505     void ResetFormAnimationStartTime();
506     void ResetFormAnimationFlag();
507     void OnAnimatedModifyDone();
508     void OnImageModifyDone();
509     void SetColorFilter(const RefPtr<FrameNode>& imageFrameNode);
510     void SetImageFit(const RefPtr<FrameNode>& imageFrameNode);
511     void ControlAnimation(int32_t index);
512     void SetObscured();
513     void OnKeyEvent();
514     CopyOptions copyOption_ = CopyOptions::None;
515     ImageInterpolation interpolation_ = ImageInterpolation::LOW;
516     bool needLoadAlt_ = true;
517     RenderedImageInfo renderedImageInfo_;
518 
519     RefPtr<ImageLoadingContext> loadingCtx_;
520     RefPtr<CanvasImage> image_;
521     RectF dstRect_;
522     RectF srcRect_;
523 
524     RefPtr<CanvasImage> obscuredImage_;
525 
526     // clear alt data after [OnImageLoadSuccess] being called
527     RefPtr<ImageLoadingContext> altLoadingCtx_;
528     RefPtr<CanvasImage> altImage_;
529     std::unique_ptr<RectF> altDstRect_;
530     std::unique_ptr<RectF> altSrcRect_;
531 
532     RefPtr<LongPressEvent> longPressEvent_;
533     RefPtr<ClickEvent> clickEvent_;
534     RefPtr<InputEvent> mouseEvent_;
535     RefPtr<Clipboard> clipboard_;
536     RefPtr<SelectOverlayProxy> selectOverlay_;
537     std::shared_ptr<ImageAnalyzerManager> imageAnalyzerManager_;
538     ImageDfxConfig imageDfxConfig_;
539     ImageDfxConfig altImageDfxConfig_;
540     bool enableDrag_ = false;
541 
542     std::function<bool(const KeyEvent& event)> keyEventCallback_ = nullptr;
543     OnProgressCallback onProgressCallback_ = nullptr;
544     bool syncLoad_ = false;
545     bool needBorderRadius_ = false;
546     AIImageQuality imageQuality_ = AIImageQuality::NONE;
547     PixelFormat externalDecodeFormat_ = PixelFormat::UNKNOWN;
548     // Flag indicating whether the image needs to be reloaded due to parameter changes.
549     bool isImageReloadNeeded_ = false;
550     bool isEnableAnalyzer_ = false;
551     bool autoResizeDefault_ = true;
552     bool isSensitive_ = false;
553     ImageInterpolation interpolationDefault_ = ImageInterpolation::NONE;
554     ImageRotateOrientation userOrientation_ = ImageRotateOrientation::UP;
555     ImageRotateOrientation selfOrientation_ = ImageRotateOrientation::UP;
556     ImageRotateOrientation joinOrientation_ = ImageRotateOrientation::UP;
557     Color selectedColor_;
558     float smoothEdge_ = 0.0f;
559     OffsetF parentGlobalOffset_;
560     bool isSelected_ = false;
561 
562     // The component has an internal encapsulation class drawable of the image.
563     // The internal drawable has an external raw pointer.
564     RefPtr<DrawableDescriptor> drawable_;
565     bool isRegisterRedrawCallback_ = false;
566 
567     ACE_DISALLOW_COPY_AND_MOVE(ImagePattern);
568 
569     // After the animated drawable descriptor code goes online, need to
570     // remove all the following codes.
571     ImageType imageType_ = ImageType::BASE;
572     RefPtr<Animator> animator_;
573     std::vector<ImageProperties> images_;
574     std::list<CacheImageStruct> cacheImages_;
575     Animator::Status status_ = Animator::Status::IDLE;
576     int32_t durationTotal_ = 0;
577     int32_t nowImageIndex_ = 0;
578     uint64_t repeatCallbackId_ = 0;
579     bool imagesChangedFlag_ = false;
580     bool firstUpdateEvent_ = true;
581     bool isLayouted_ = false;
582     int64_t formAnimationStartTime_ = 0;
583     int32_t formAnimationRemainder_ = 0;
584     bool isOrientationChange_ = false;
585     bool isFormAnimationStart_ = true;
586     bool isFormAnimationEnd_ = false;
587     bool isImageAnimator_ = false;
588     bool hasSizeChanged = false;
589     bool isPixelMapChanged_ = false;
590     bool isSrcUndefined_ = false;
591     bool isComponentSnapshotNode_ = false;
592     bool isNeedReset_ = false;
593 };
594 
595 } // namespace OHOS::Ace::NG
596 
597 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERNS_IMAGE_IMAGE_PATTERN_H
598