1 /* 2 * Copyright (c) 2024 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_IMAGE_FILTER_H 17 #define C_INCLUDE_DRAWING_IMAGE_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 12 28 * @version 1.0 29 */ 30 31 /** 32 * @file drawing_image_filter.h 33 * 34 * @brief Declares functions related to the <b>imageFilter</b> object in the drawing module. 35 * 36 * @since 12 37 * @version 1.0 38 */ 39 40 #include "drawing_shader_effect.h" 41 42 #ifdef __cplusplus 43 extern "C" { 44 #endif 45 46 /** 47 * @brief Creates an <b>OH_Drawing_ImageFilter</b> object that blurs its input by the separate x and y sigmas. 48 * 49 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 50 * @param sigmaX Indicates the Gaussian sigma value for blurring along the x axis. 51 * @param sigmaY Indicates the Gaussian sigma value for blurring along the y axis. 52 * @param OH_Drawing_TileMode Indicates the tile mode applied at edges. 53 * @param OH_Drawing_ImageFilter Indicates the input filter that is blurred, uses source bitmap if this is null. 54 * @return Returns the pointer to the <b>OH_Drawing_ImageFilter</b> object created. 55 * @since 12 56 * @version 1.0 57 */ 58 OH_Drawing_ImageFilter* OH_Drawing_ImageFilterCreateBlur(float sigmaX, float sigmaY, OH_Drawing_TileMode, 59 OH_Drawing_ImageFilter*); 60 61 /** 62 * @brief Creates an <b>OH_Drawing_ImageFilter</b> object that applies the color filter to the input. 63 * 64 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 65 * @param OH_Drawing_ColorFilter Indicates the color filter that transforms the input image. 66 * @param OH_Drawing_ImageFilter Indicates the input filter, or uses the source bitmap if this is null. 67 * @return Returns the pointer to the <b>OH_Drawing_ImageFilter</b> object created. 68 * @since 12 69 * @version 1.0 70 */ 71 OH_Drawing_ImageFilter* OH_Drawing_ImageFilterCreateFromColorFilter(OH_Drawing_ColorFilter*, OH_Drawing_ImageFilter*); 72 73 /** 74 * @brief Destroys an <b>OH_Drawing_ImageFilter</b> object and reclaims the memory occupied by the object. 75 * 76 * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing 77 * @param OH_Drawing_ImageFilter Indicates the pointer to an <b>OH_Drawing_ImageFilter</b> object. 78 * @since 12 79 * @version 1.0 80 */ 81 void OH_Drawing_ImageFilterDestroy(OH_Drawing_ImageFilter*); 82 83 #ifdef __cplusplus 84 } 85 #endif 86 /** @} */ 87 #endif