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 /** 17 * @addtogroup image 18 * @{ 19 * 20 * @brief Provides APIs for obtaining effect filter and information. 21 * 22 * @syscap SystemCapability.Multimedia.Image.Core 23 * @since 12 24 */ 25 26 /** 27 * @file effect_types.h 28 * 29 * @brief Declares the data types for effect filter. 30 * 31 * @library libnative_effect.so 32 * @syscap SystemCapability.Multimedia.Image.Core 33 * @since 12 34 */ 35 36 #ifndef C_INCLUDE_EFFECT_TYPES_H 37 #define C_INCLUDE_EFFECT_TYPES_H 38 39 #include <stdint.h> 40 #include <stddef.h> 41 42 #ifdef __cplusplus 43 extern "C" { 44 #endif 45 46 /** 47 * @brief Defines a effect filter. 48 * 49 * @since 12 50 * @version 1.0 51 */ 52 typedef struct OH_Filter OH_Filter; 53 54 /** 55 * @brief Defines a pixelmap. 56 * 57 * @since 12 58 * @version 1.0 59 */ 60 typedef struct OH_PixelmapNative OH_PixelmapNative; 61 62 /** 63 * @brief Defines a matrix for create effect filter. 64 * 65 * @since 12 66 * @version 1.0 67 */ 68 struct OH_Filter_ColorMatrix { 69 /** val mast be 5*4 */ 70 float val[20]; 71 }; 72 73 /** 74 * @brief Defines a effect filter error code. 75 * 76 * @since 12 77 * @version 1.0 78 */ 79 typedef enum { 80 /** success */ 81 EFFECT_SUCCESS = 0, 82 /** invalid parameter */ 83 EFFECT_BAD_PARAMETER = 401, 84 /** unsupported operations */ 85 EFFECT_UNSUPPORTED_OPERATION = 7600201, 86 /** unknown error */ 87 EFFECT_UNKNOWN_ERROR = 7600901, 88 } EffectErrorCode; 89 90 /** 91 * @brief Defines a effect filter tile mode. 92 * 93 * @since 14 94 */ 95 typedef enum { 96 /** Replicate the edge color if the shader draws outside of its original bounds */ 97 CLAMP = 0, 98 /** Repeat the shader's image horizontally and vertically */ 99 REPEAT, 100 /** Repeat the shader's image horizontally and vertically, 101 * alternating mirror images so that adjacent images always seam 102 */ 103 MIRROR, 104 /** Only draw within the original domain, return transparent-black everywhere else */ 105 DECAL, 106 } EffectTileMode; 107 108 #ifdef __cplusplus 109 } 110 #endif 111 /** @} */ 112 #endif