1 /*
2  * Copyright (c) 2023 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 C_INCLUDE_DRAWING_MASK_FILTER_H
17 #define C_INCLUDE_DRAWING_MASK_FILTER_H
18 
19 /**
20  * @addtogroup Drawing
21  * @{
22  *
23  * @brief Provides functions such as 2D graphics rendering, text drawing, and image display.
24  *
25  * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
26  *
27  * @since 11
28  * @version 1.0
29  */
30 
31 /**
32  * @file drawing_mask_filter.h
33  *
34  * @brief Declares functions related to the <b>maskFilter</b> object in the drawing module.
35  *
36  * @since 11
37  * @version 1.0
38  */
39 
40 #include "drawing_types.h"
41 
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45 
46 /**
47  * @brief Enumerates blur type.
48  *
49  * @since 11
50  * @version 1.0
51  */
52 typedef enum {
53     /**
54      * Fuzzy inside and outside.
55      */
56     NORMAL,
57     /**
58      * Solid inside, fuzzy outside.
59      */
60     SOLID,
61     /**
62      * Nothing inside, fuzzy outside.
63      */
64     OUTER,
65     /**
66      * Fuzzy inside, nothing outside.
67      */
68     INNER,
69 } OH_Drawing_BlurType;
70 
71 /**
72  * @brief Creates an <b>OH_Drawing_MaskFilter</b> with a blur effect.
73  *
74  * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
75  * @param blurType Indicates the blur type.
76  * @param sigma Indicates the standard deviation of the Gaussian blur to apply. Must be > 0.
77  * @param respectCTM Indicates the blur's sigma is modified by the CTM, default is true.
78  * @return Returns the pointer to the <b>OH_Drawing_MaskFilter</b> object created.
79  * @since 11
80  * @version 1.0
81  */
82 OH_Drawing_MaskFilter* OH_Drawing_MaskFilterCreateBlur(OH_Drawing_BlurType blurType, float sigma, bool respectCTM);
83 
84 /**
85  * @brief Destroys an <b>OH_Drawing_MaskFilter</b> object and reclaims the memory occupied by the object.
86  *
87  * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing
88  * @param OH_Drawing_MaskFilter Indicates the pointer to an <b>OH_Drawing_MaskFilter</b> object.
89  * @since 11
90  * @version 1.0
91  */
92 void OH_Drawing_MaskFilterDestroy(OH_Drawing_MaskFilter*);
93 
94 #ifdef __cplusplus
95 }
96 #endif
97 /** @} */
98 #endif
99