1 /*
2  * Copyright (c) 2022 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 GRAPHIC_LITE_PAINT_H
16 #define GRAPHIC_LITE_PAINT_H
17 
18 #include "gfx_utils/diagram/imagefilter/filter_blur.h"
19 #include "gfx_utils/diagram/spancolorfill/fill_pattern_rgba.h"
20 #include "gfx_utils/diagram/vertexprimitive/geometry_math_stroke.h"
21 #include "gfx_utils/diagram/vertexprimitive/geometry_path_storage.h"
22 #include "gfx_utils/list.h"
23 
24 namespace OHOS {
25 
26 /**
27  * @brief Defines the basic styles of graphs drawn on canvases.
28  *
29  * @since 1.0
30  * @version 1.0
31  */
32 class Paint : public HeapBase {
33     const uint16_t DEFAULT_STROKE_WIDTH = 2;
34 public:
35     /**
36      * @brief A constructor used to create a <b>Paint</b> instance.
37      *
38      * @since 1.0
39      * @version 1.0
40      */
Paint()41     Paint()
42         : style_(PaintStyle::STROKE_FILL_STYLE),
43           fillColor_(Color::Black()),
44           strokeColor_(Color::White()),
45           opacity_(OPA_OPAQUE),
46           strokeWidth_(DEFAULT_STROKE_WIDTH),
47           changeFlag_(false),
48 #if defined(GRAPHIC_ENABLE_LINEJOIN_FLAG) && GRAPHIC_ENABLE_LINEJOIN_FLAG
49           lineJoin_(LineJoin::ROUND_JOIN),
50 #endif
51 #if defined(GRAPHIC_ENABLE_LINECAP_FLAG) && GRAPHIC_ENABLE_LINECAP_FLAG
52           lineCap_(LineCap::BUTT_CAP),
53 #endif
54 #if defined(GRAPHIC_ENABLE_DASH_GENERATE_FLAG) && GRAPHIC_ENABLE_DASH_GENERATE_FLAG
55           isDashMode_(false),
56           dashOffset_(0),
57           dashArray_(nullptr),
58           ndashes_(0),
59 #endif
60 #if defined(GRAPHIC_ENABLE_LINEJOIN_FLAG) && GRAPHIC_ENABLE_LINEJOIN_FLAG
61           miterLimit_(0),
62 #endif
63 #if defined(GRAPHIC_ENABLE_GRADIENT_FILL_FLAG) && GRAPHIC_ENABLE_GRADIENT_FILL_FLAG
64           linearGradientPoint_({0, 0, 0, 0}),
65           radialGradientPoint_({0, 0, 0, 0, 0, 0}),
66           stopAndColors_({}),
67           gradientflag_(Linear),
68 #endif
69 #if defined(GRAPHIC_ENABLE_PATTERN_FILL_FLAG) && GRAPHIC_ENABLE_PATTERN_FILL_FLAG
70           patternRepeat_(REPEAT),
71 #endif
72 #if defined(GRAPHIC_ENABLE_PATTERN_FILL_FLAG) && GRAPHIC_ENABLE_PATTERN_FILL_FLAG
73           image_(nullptr),
74 #endif
75 #if defined(GRAPHIC_ENABLE_SHADOW_EFFECT_FLAG) && GRAPHIC_ENABLE_SHADOW_EFFECT_FLAG
76           shadowBlurRadius_(0),
77           shadowOffsetX_(0.0f),
78           shadowOffsetY_(0.0f),
79           shadowColor_(Color::Black()),
80           haveShadow_(false),
81 #endif
82           globalAlpha_(1.0),
83           globalCompositeOperation_(SOURCE_OVER),
84           rotateAngle_(0),
85           scaleRadioX_(1.0f),
86           scaleRadioY_(1.0f),
87           translationX_(0),
88           translationY_(0),
89           haveComposite_(false)
90     {
91     }
92 
Paint(const Paint & paint)93     Paint(const Paint& paint)
94     {
95         Init(paint);
96     }
97 
98     void InitDash(const Paint& paint);
99 
100     void Init(const Paint& paint);
101 
102 
103     /**
104      * @brief A destructor used to delete the <b>Paint</b> instance.
105      *
106      * @since 1.0
107      * @version 1.0
108      */
~Paint()109     virtual ~Paint() {}
110 
111     const Paint& operator=(const Paint& paint)
112     {
113         Init(paint);
114         return *this;
115     }
116     /**
117      * @brief Enumerates paint styles of a closed graph. The styles are invalid for non-closed graphs.
118      */
119     enum PaintStyle {
120         /** Stroke only */
121         STROKE_STYLE = 1,
122         /** Fill only */
123         FILL_STYLE,
124         /** Stroke and fill */
125         STROKE_FILL_STYLE,
126         /** Gradual change */
127         GRADIENT,
128         /** Image mode */
129         PATTERN
130     };
131 
132     struct LinearGradientPoint {
133         /**  Start point coordinate x  */
134         float x0;
135         /**  Start point coordinate y  */
136         float y0;
137         /**  End point coordinate x  */
138         float x1;
139         /**  End point coordinate y  */
140         float y1;
141     };
142 
143     struct RadialGradientPoint {
144         /**  Start dot coordinate x  */
145         float x0;
146         /** Start dot coordinate y  */
147         float y0;
148         /**  Start circle radius r0  */
149         float r0;
150         /**  End dot coordinates x  */
151         float x1;
152         /**  End dot coordinates y  */
153         float y1;
154         /**  Start circle radius r0  */
155         float r1;
156     };
157 
158     struct StopAndColor {
159         /** Values between 0.0 and 1.0 represent the position between the beginning and end of the ramp.  */
160         float stop;
161         /** The color value displayed at the end */
162         ColorType color;
163     };
164 
165     enum Gradient { Linear, Radial };
166 
167     /**
168      * @brief Sets the paint style of a closed graph.
169      *
170      * @param style Indicates the paint style. Stroke and fill are set by default.
171      * For details, see {@link PaintStyle}.
172      * @see GetStyle
173      * @since 1.0
174      * @version 1.0
175      */
SetStyle(PaintStyle style)176     void SetStyle(PaintStyle style)
177     {
178         style_ = style;
179     }
180 
181     /**
182      * @brief Sets the paint style.
183      *
184      * @param color value.
185      * @since 1.0
186      * @version 1.0
187      */
188     void SetStrokeStyle(ColorType color);
189 
190     /**
191      * @brief Sets fill style.
192      *
193      * @param color value.
194      * @since 1.0
195      * @version 1.0
196      */
197     void SetFillStyle(ColorType color);
198 
199     /**
200      * @brief Sets the paint stroke style of a closed graph.
201      *
202      * @param style Indicates the paint style. Stroke and fill are set by default.
203      * @since 1.0
204      * @version 1.0
205      */
SetStrokeStyle(PaintStyle style)206     void SetStrokeStyle(PaintStyle style)
207     {
208         SetStyle(style);
209     }
210 
211     /**
212      * @brief Sets the paint fill style of a closed graph.
213      *
214      * @param style Indicates the paint style. Stroke and fill are set by default.
215      * @since 1.0
216      * @version 1.0
217      */
SetFillStyle(PaintStyle style)218     void SetFillStyle(PaintStyle style)
219     {
220         SetStyle(style);
221     }
222 
223     /**
224      * @brief Obtains the paint style of a closed graph.
225      *
226      * @return Returns the paint style. For details, see {@link PaintStyle}.
227      * @see SetStyle
228      * @since 1.0
229      * @version 1.0
230      */
GetStyle()231     PaintStyle GetStyle() const
232     {
233         return style_;
234     }
235 
236     /**
237      * @brief Sets the width of a line or border.
238      *
239      * @param width Indicates the line width when a line is drawn or the border width when a closed graph is drawn.
240      *        The width is extended to both sides.
241      * @see GetStrokeWidth
242      * @since 1.0
243      * @version 1.0
244      */
SetStrokeWidth(uint16_t width)245     void SetStrokeWidth(uint16_t width)
246     {
247         strokeWidth_ = width;
248     }
249 
250     /**
251      * @brief Obtains the width of a line or border.
252      *
253      * @return Returns the line width if a line is drawn or the border width if a closed graph is drawn.
254      * @see SetStrokeWidth
255      * @since 1.0
256      * @version 1.0
257      */
GetStrokeWidth()258     uint16_t GetStrokeWidth() const
259     {
260         return strokeWidth_;
261     }
262 
263     /**
264      * @brief Sets the color of a line or border.
265      *
266      * @param color Indicates the line color when a line is drawn or the border color when a closed graph is drawn.
267      * @see GetStrokeColor
268      * @since 1.0
269      * @version 1.0
270      */
271     void SetStrokeColor(ColorType color);
272 
273     /**
274      * @brief Obtains the color of a line or border.
275      *
276      * @return Returns the line color if a line is drawn or the border color if a closed graph is drawn.
277      * @see SetStrokeWidth
278      * @since 1.0
279      * @version 1.0
280      */
GetStrokeColor()281     ColorType GetStrokeColor() const
282     {
283         return strokeColor_;
284     }
285 
286     /**
287      * @brief Sets fill color.
288      *
289      * This function is valid only for closed graphs.
290      *
291      * @param color Indicates the fill color to set.
292      * @see GetFillColor
293      * @since 1.0
294      * @version 1.0
295      */
296     void SetFillColor(ColorType color);
297 
298     /**
299      * @brief Obtains the fill color.
300      *
301      * @return Returns the fill color.
302      * @see SetFillColor
303      * @since 1.0
304      * @version 1.0
305      */
GetFillColor()306     ColorType GetFillColor() const
307     {
308         return fillColor_;
309     }
310 
311     /**
312      * @brief Sets the opacity.
313      *
314      * The setting takes effect for the entire graph, including the border, line color, and fill color.
315      *
316      * @param opacity Indicates the opacity. The value range is [0, 255].
317      * @see GetOpacity
318      * @since 1.0
319      * @version 1.0
320      */
SetOpacity(uint8_t opacity)321     void SetOpacity(uint8_t opacity)
322     {
323         opacity_ = opacity;
324     }
325 
326     /**
327      * @brief Obtains the opacity.
328      *
329      * @return Returns the opacity.
330      * @see SetOpacity
331      * @since 1.0
332      * @version 1.0
333      */
GetOpacity()334     uint8_t GetOpacity() const
335     {
336         return opacity_;
337     }
338 
GetChangeFlag()339     bool GetChangeFlag() const
340     {
341         return changeFlag_;
342     }
343 
344 #if defined(GRAPHIC_ENABLE_LINECAP_FLAG) && GRAPHIC_ENABLE_LINECAP_FLAG
345     /**
346      * @brief Sets the cap type.
347      * @see GetLineCap
348      * @since 1.0
349      * @version 1.0
350      */
351     void SetLineCap(LineCap lineCap);
352 #endif
353 
354 #if defined(GRAPHIC_ENABLE_LINECAP_FLAG) && GRAPHIC_ENABLE_LINECAP_FLAG
355     /**
356      * @brief Gets the cap type.
357      * @see SetLineCap
358      * @since 1.0
359      * @version 1.0
360      */
GetLineCap()361     LineCap GetLineCap() const
362     {
363         return lineCap_;
364     }
365 #endif
366 
367 #if defined(GRAPHIC_ENABLE_LINEJOIN_FLAG) && GRAPHIC_ENABLE_LINEJOIN_FLAG
368     /**
369      * @brief Sets the style at the path connection of the pen.
370      * @see GetLineJoin
371      * @since 1.0
372      * @version 1.0
373      */
374     void SetLineJoin(LineJoin lineJoin);
375 #endif
376 
377 #if defined(GRAPHIC_ENABLE_LINEJOIN_FLAG) && GRAPHIC_ENABLE_LINEJOIN_FLAG
378     /**
379      * @brief Sets the spacing limit for sharp corners at path connections.
380      * @see GetMiterLimit
381      * @since 1.0
382      * @version 1.0
383      */
384     void SetMiterLimit(float miterLimit);
385 #endif
386 
387 #if defined(GRAPHIC_ENABLE_LINEJOIN_FLAG) && GRAPHIC_ENABLE_LINEJOIN_FLAG
GetMiterLimit()388     float GetMiterLimit() const
389     {
390         return miterLimit_;
391     }
392 #endif
393 
394 #if defined(GRAPHIC_ENABLE_LINEJOIN_FLAG) && GRAPHIC_ENABLE_LINEJOIN_FLAG
395     /**
396      * @brief Gets the style at the path connection of the pen.
397      * @see SetLineJoin
398      * @since 1.0
399      * @version 1.0
400      */
GetLineJoin()401     LineJoin GetLineJoin() const
402     {
403         return lineJoin_;
404     }
405 #endif
406 
407 #if defined(GRAPHIC_ENABLE_DASH_GENERATE_FLAG) && GRAPHIC_ENABLE_DASH_GENERATE_FLAG
IsLineDash()408     bool IsLineDash() const
409     {
410         return isDashMode_;
411     }
412 
413     /**
414      * @brief Sets the array and number of dashes.
415      * @param lineDashs Represents an array of dotted lines,ndash Indicates the number of dotted lines
416      * @since 1.0
417      * @version 1.0
418      */
419     void SetLineDash(float* lineDashs, const uint32_t ndash);
420 
421     /**
422      * @brief Get dash array
423      * @return
424      */
GetLineDash()425     float* GetLineDash() const
426     {
427         return dashArray_;
428     }
429 
GetLineDashOffset()430     float GetLineDashOffset() const
431     {
432         return dashOffset_;
433     }
434 
435     /**
436      * @brief Sets the offset of the dash mode start point
437      * @see GetLineDashOffset
438      * @since 1.0
439      * @version 1.0
440      */
441     void SetLineDashOffset(float offset);
442 
443     /**
444      * @brief Get dash array length
445      * @return
446      */
GetLineDashCount()447     uint32_t GetLineDashCount() const
448     {
449         return ndashes_;
450     }
451 
452     /**
453      * @brief Empty the dotted line and draw it instead.
454      * @since 1.0
455      * @version 1.0
456      */
457     void ClearLineDash(void);
458 #endif
459 
460 #if defined(GRAPHIC_ENABLE_GRADIENT_FILL_FLAG) && GRAPHIC_ENABLE_GRADIENT_FILL_FLAG
461     void createLinearGradient(float startx, float starty, float endx, float endy);
462 
463     void addColorStop(float stop, ColorType color);
464 
465     void createRadialGradient(float start_x, float start_y, float start_r, float end_x, float end_y, float end_r);
466 
getStopAndColor()467     List<StopAndColor> getStopAndColor() const
468     {
469         return stopAndColors_;
470     }
471 
GetLinearGradientPoint()472     LinearGradientPoint GetLinearGradientPoint() const
473     {
474         return linearGradientPoint_;
475     }
476 
GetRadialGradientPoint()477     RadialGradientPoint GetRadialGradientPoint() const
478     {
479         return radialGradientPoint_;
480     }
481 
GetGradient()482     Gradient GetGradient() const
483     {
484         return gradientflag_;
485     }
486 #endif
487 
488 #if defined(GRAPHIC_ENABLE_PATTERN_FILL_FLAG) && GRAPHIC_ENABLE_PATTERN_FILL_FLAG
489     /*
490      * Set hatch patterns for elements
491      * @param img Represents the pattern of the hatch,text Represents a fill pattern
492      */
493     void CreatePattern(const char* img, PatternRepeatMode patternRepeat);
494 
GetPatternImage()495     const char* GetPatternImage() const
496     {
497         return image_;
498     }
499 
GetPatternRepeatMode()500     PatternRepeatMode GetPatternRepeatMode() const
501     {
502         return patternRepeat_;
503     }
504 #endif
505 
506 #if defined(GRAPHIC_ENABLE_SHADOW_EFFECT_FLAG) && GRAPHIC_ENABLE_SHADOW_EFFECT_FLAG
507     /**
508      * @brief Sets the shadow blur level.
509      * @since 1.0
510      * @version 1.0
511      */
512     void SetShadowBlur(uint16_t radius);
513 
514     /**
515      * @brief Gets the shadow blur level.
516      * @since 1.0
517      * @version 1.0
518      */
GetShadowBlur()519     uint16_t GetShadowBlur() const
520     {
521         return shadowBlurRadius_;
522     }
523 
524     /**
525      * @brief Gets the abscissa offset of the shadow.
526      * @since 1.0
527      * @version 1.0
528      */
GetShadowOffsetX()529     float GetShadowOffsetX() const
530     {
531         return shadowOffsetX_;
532     }
533     /**
534      * @brief Sets the abscissa offset of the shadow.
535      * @since 1.0
536      * @version 1.0
537      */
538     void SetShadowOffsetX(float offset);
539     /**
540      * @brief Gets the shadow ordinate offset.
541      * @since 1.0
542      * @version 1.0
543      */
GetShadowOffsetY()544     float GetShadowOffsetY() const
545     {
546         return shadowOffsetY_;
547     }
548     /**
549      * @brief Sets the shadow ordinate offset.
550      * @since 1.0
551      * @version 1.0
552      */
553     void SetShadowOffsetY(float offset);
554     /**
555      * @brief Gets the color value of the shadow.
556      * @since 1.0
557      * @version 1.0
558      */
GetShadowColor()559     ColorType GetShadowColor() const
560     {
561         return shadowColor_;
562     }
563     /**
564      * @brief Sets the color value of the shadow.
565      * @since 1.0
566      * @version 1.0
567      */
568     void SetShadowColor(ColorType color);
HaveShadow()569     bool HaveShadow() const
570     {
571         return haveShadow_;
572     }
573 #endif
574     /**
575      * @brief Sets the alpha of the current drawing.
576      */
577     void SetGlobalAlpha(float alphaPercentage);
578 
579     /**
580      * @brief get the alpha of the current drawing
581      * @return Returns the alpha of the current drawing
582      * @since 1.0
583      * @version 1.0
584      */
GetGlobalAlpha()585     float GetGlobalAlpha() const
586     {
587         return globalAlpha_;
588     }
589 
590     /**
591      * @brief Set blend mode
592      */
593     void SetGlobalCompositeOperation(GlobalCompositeOperation globalCompositeOperation);
594 
595     /**
596      * @brief Get blend mode
597      */
GetGlobalCompositeOperation()598     GlobalCompositeOperation GetGlobalCompositeOperation() const
599     {
600         return globalCompositeOperation_;
601     }
602 
603     /* Zooms the current drawing to a larger or smaller size */
604     void Scale(float scaleX, float scaleY);
605 
606     /**
607      * @brief get the x coordinate scale value
608      * @since 1.0
609      * @version 1.0
610      */
GetScaleX()611     float GetScaleX() const
612     {
613         return this->scaleRadioX_;
614     }
615 
616     /**
617      * @brief get the y coordinate scale value
618      * @since 1.0
619      * @version 1.0
620      */
GetScaleY()621     float GetScaleY() const
622     {
623         return this->scaleRadioY_;
624     }
625 
626     /**
627      * @brief Rotate current drawing
628      * @param angle rotate angle value.
629      * @since 1.0
630      * @version 1.0
631      */
632     void Rotate(float angle);
633 
634     /**
635      * @brief Rotate current drawing
636      * @param angle rotate angle value.
637      * @param x translate x coordinate.
638      * @param y translate y coordinate.
639      * @since 1.0
640      * @version 1.0
641      */
642     void Rotate(float angle, int16_t x, int16_t y);
643 
644     /**
645      * @brief Remap the (x, y) position on the canvas
646      * @param x translate x coordinate.
647      * @param y translate y coordinate.
648      * @since 1.0
649      * @version 1.0
650      */
651     void Translate(int16_t x, int16_t y);
652 
653     /**
654      * @brief Gets the x position on the remapping canvas
655      * @since 1.0
656      * @version 1.0
657      */
GetTranslateX()658     int16_t GetTranslateX() const
659     {
660         return this->translationX_;
661     }
662 
663     /**
664      * @brief Gets the Y position on the remapping canvas
665      * @since 1.0
666      * @version 1.0
667      */
GetTranslateY()668     int16_t GetTranslateY() const
669     {
670         return this->translationY_;
671     }
672 
673     /**
674      * @brief Resets the current conversion to the identity matrix. Then run transform ()
675      * @param scaleX scale x value.
676      * @param shearX shear x value.
677      * @param shearY shear y value.
678      * @param scaleY scale y value
679      * @param transLateX translate x coordinate.
680      * @param transLateY translate y coordinate.
681      * @since 1.0
682      * @version 1.0
683      */
684     void SetTransform(float scaleX, float shearX, float shearY, float scaleY, int16_t transLateX, int16_t transLateY);
685 
686     /**
687      * @brief Resets the current conversion to the identity matrix. Then run transform ()
688      * @param scaleX scale x value.
689      * @param shearX shear x value.
690      * @param shearY shear y value.
691      * @param scaleY scale y value
692      * @param transLateX translate x coordinate.
693      * @param transLateY translate y coordinate.
694      * @since 1.0
695      * @version 1.0
696      */
697     void Transform(float scaleX, float shearX, float shearY, float scaleY, int16_t transLateX, int16_t transLateY);
698 
699     /**
700      * @brief Gets the Trans Affine
701      * @since 1.0
702      * @version 1.0
703      */
GetTransAffine()704     TransAffine GetTransAffine() const
705     {
706         return transfrom_;
707     }
708 
709     /**
710      * @brief Gets the Rotate Angle
711      * @since 1.0
712      * @version 1.0
713      */
GetRotateAngle()714     float GetRotateAngle() const
715     {
716         return rotateAngle_;
717     }
718 
HaveComposite()719     bool HaveComposite() const
720     {
721         return haveComposite_;
722     }
723 
724 #if defined(GRAPHIC_ENABLE_BLUR_EFFECT_FLAG) && GRAPHIC_ENABLE_BLUR_EFFECT_FLAG
725     Filterblur drawBlur;
GetDrawBoxBlur()726     Filterblur GetDrawBoxBlur() const
727     {
728         return drawBlur;
729     }
730 #endif
731 
732 private:
733     PaintStyle style_;
734     ColorType fillColor_;
735     ColorType strokeColor_;
736     uint8_t opacity_;
737     uint16_t strokeWidth_;
738     bool changeFlag_;
739 #if defined(GRAPHIC_ENABLE_LINEJOIN_FLAG) && GRAPHIC_ENABLE_LINEJOIN_FLAG
740     LineJoin lineJoin_;
741 #endif
742 
743 #if defined(GRAPHIC_ENABLE_LINECAP_FLAG) && GRAPHIC_ENABLE_LINECAP_FLAG
744     LineCap lineCap_;
745 #endif
746 #if defined(GRAPHIC_ENABLE_DASH_GENERATE_FLAG) && GRAPHIC_ENABLE_DASH_GENERATE_FLAG
747     bool isDashMode_;  // Is it a dash mode segment.
748     float dashOffset_; // dash Point offset.
749     float* dashArray_; // dash Point array.
750     uint32_t ndashes_; // Length of dasharray
751 #endif
752 #if defined(GRAPHIC_ENABLE_LINEJOIN_FLAG) && GRAPHIC_ENABLE_LINEJOIN_FLAG
753     float miterLimit_; // Sets the spacing limit for sharp corners at path connections
754 #endif
755 #if defined(GRAPHIC_ENABLE_GRADIENT_FILL_FLAG) && GRAPHIC_ENABLE_GRADIENT_FILL_FLAG
756     LinearGradientPoint linearGradientPoint_;
757     RadialGradientPoint radialGradientPoint_;
758     List<StopAndColor> stopAndColors_;
759     Gradient gradientflag_;
760 #endif
761 #if defined(GRAPHIC_ENABLE_PATTERN_FILL_FLAG) && GRAPHIC_ENABLE_PATTERN_FILL_FLAG
762     PatternRepeatMode patternRepeat_;
763 #endif
764 #if defined(GRAPHIC_ENABLE_PATTERN_FILL_FLAG) && GRAPHIC_ENABLE_PATTERN_FILL_FLAG
765     const char* image_;
766 #endif
767 #if defined(GRAPHIC_ENABLE_SHADOW_EFFECT_FLAG) && GRAPHIC_ENABLE_SHADOW_EFFECT_FLAG
768     uint16_t shadowBlurRadius_; // Sets the shadow blur radius.
769     float shadowOffsetX_;       // Sets the abscissa offset of the shadow.
770     float shadowOffsetY_;       // Sets the shadow ordinate offset.
771     ColorType shadowColor_;     // Set shadow color.
772     bool haveShadow_;           // Is there a shadow currently.
773 #endif
774     float globalAlpha_;                                 // The transparency of the current drawing is 0-1 percent
775     GlobalCompositeOperation globalCompositeOperation_; // Mixed image mode
776     float rotateAngle_;                                 // Rotation angle in degrees
777     float scaleRadioX_;
778     float scaleRadioY_;
779     int32_t translationX_;
780     int32_t translationY_;
781     TransAffine transfrom_; // matrix.
782     bool haveComposite_;
783 };
784 } // namespace OHOS
785 
786 #endif // GRAPHIC_LITE_PAINT_H
787