diff --git a/graphic/graphic_2d/native_effect/effect_filter.h b/graphic/graphic_2d/native_effect/effect_filter.h index f743d587ed3bae6854b5b852604f4b10866a003a..42ea52a7175a7ec95081b2be088d46b1c7b69895 100644 --- a/graphic/graphic_2d/native_effect/effect_filter.h +++ b/graphic/graphic_2d/native_effect/effect_filter.h @@ -77,6 +77,20 @@ EffectErrorCode OH_Filter_Release(OH_Filter* filter); */ EffectErrorCode OH_Filter_Blur(OH_Filter* filter, float radius); +/** + * @brief Creates a blur effect and then add to the filter. + * + * @syscap SystemCapability.Multimedia.Image.Core + * @param filter The OH_Filter pointer will be operated. + * @param radius The radius of the blur effect. + * @param tileMode The tileMode of the blur effect. + * @return BlurWithTileMode result code. + * {@link EFFECT_SUCCESS} if the operation is successful. + * {@link EFFECT_BAD_PARAMETER} if parameter is invalid. + * @since 14 + */ +EffectErrorCode OH_Filter_BlurWithTileMode(OH_Filter* filter, float radius, EffectTileMode tileMode); + /** * @brief Creates a brighten effect and then add to the filter. * diff --git a/graphic/graphic_2d/native_effect/effect_types.h b/graphic/graphic_2d/native_effect/effect_types.h index 3d40a63fb8b4d467b3c839812814a1e92496f5e0..6e6bf8d5fd19950bc78335d7ba75b782b708d56d 100644 --- a/graphic/graphic_2d/native_effect/effect_types.h +++ b/graphic/graphic_2d/native_effect/effect_types.h @@ -88,6 +88,24 @@ typedef enum { EFFECT_UNKNOWN_ERROR = 7600901, } EffectErrorCode; +/** + * @brief Defines a effect filter tile mode. + * + * @since 14 + */ +typedef enum { + /** Replicate the edge color if the shader draws outside of its original bounds */ + CLAMP = 0, + /** Repeat the shader's image horizontally and vertically */ + REPEAT, + /** Repeat the shader's image horizontally and vertically, + * alternating mirror images so that adjacent images always seam + */ + MIRROR, + /** Only draw within the original domain, return transparent-black everywhere else */ + DECAL, +} EffectTileMode; + #ifdef __cplusplus } #endif diff --git a/graphic/graphic_2d/native_effect/libnative_effect.ndk.json b/graphic/graphic_2d/native_effect/libnative_effect.ndk.json index 83a34f0a782411e09fdb9a8c930070d29465e94c..c97ec522d64f85da66fe3d3745a9d1acb5342b51 100644 --- a/graphic/graphic_2d/native_effect/libnative_effect.ndk.json +++ b/graphic/graphic_2d/native_effect/libnative_effect.ndk.json @@ -2,6 +2,7 @@ { "name": "OH_Filter_CreateEffect" }, { "name": "OH_Filter_Release" }, { "name": "OH_Filter_Blur" }, + { "name": "OH_Filter_BlurWithTileMode" }, { "name": "OH_Filter_Brighten" }, { "name": "OH_Filter_GrayScale" }, { "name": "OH_Filter_Invert" },