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