diff --git a/graphic/graphic_2d/native_drawing/drawing_path_effect.h b/graphic/graphic_2d/native_drawing/drawing_path_effect.h index b3260d576e27c033b8091db77e436454def765c9..3ee157ee72d33b4e649f1c6f4a94cfc9a440319d 100644 --- a/graphic/graphic_2d/native_drawing/drawing_path_effect.h +++ b/graphic/graphic_2d/native_drawing/drawing_path_effect.h @@ -46,6 +46,21 @@ extern "C" { #endif +/** + * @brief Enumerate path effect types. + * + * @since 14 + * @version 1.0 + */ +typedef enum { + /** Indicates that the path effect is a translation effect. */ + PATH_EFFECT_TRANSLATE, + /** Indicates that the path effect is a rotation effect. */ + PATH_EFFECT_ROTATE, + /** Indicates that the path effect is a morph effect. */ + PATH_EFFECT_MORPH, +} OH_Drawing_PathEffectType; + /** * @brief Creates an OH_Drawing_PathEffect object. * @@ -59,6 +74,34 @@ extern "C" { */ OH_Drawing_PathEffect* OH_Drawing_CreateDashPathEffect(float* intervals, int count, float phase); +/** + * @brief Creates an OH_Drawing_PathEffect object and sets the path effect to a dash effect. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param path Indicates the pointer to an OH_Drawing_Path object. + * @param advance Indicates the distance between the dashed segments. + * @param phase Indicates the offset into intervals array. + * @param type Indicates the type of the path effect. + * @return Returns the pointer to the OH_Drawing_PathEffect object created. + * @since 14 + * @version 1.0 + */ +OH_Drawing_PathEffect* OH_Drawing_CreatePathDashEffect(const OH_Drawing_Path* path, float advance, float phase, + OH_Drawing_PathEffectType type); + +/** + * @brief Creates an OH_Drawing_PathEffect object and sum the path effect. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param pathEffectOne Indicates the pointer to an OH_Drawing_PathEffect object. + * @param pathEffectTwo Indicates the pointer to an OH_Drawing_PathEffect object. + * @return Returns the pointer to the OH_Drawing_PathEffect object created. + * @since 14 + * @version 1.0 + */ +OH_Drawing_PathEffect* OH_Drawing_CreateSumPathEffect(OH_Drawing_PathEffect* pathEffectOne, + OH_Drawing_PathEffect* pathEffectTwo); + /** * @brief Destroys an OH_Drawing_PathEffect object and reclaims the memory occupied by the object. * diff --git a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json index 353ce3f539771d30cdac90947de31c81c38d3c4d..8b77381846f7caa48d24a372ade5b85241f077bf 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -152,6 +152,14 @@ "name": "OH_Drawing_CanvasGetImageInfo" }, { "name": "OH_Drawing_CreateDashPathEffect" }, + { + "first_introduced": "14", + "name": "OH_Drawing_CreatePathDashEffect" + }, + { + "first_introduced": "14", + "name": "OH_Drawing_CreateSumPathEffect" + }, { "name": "OH_Drawing_PathEffectDestroy" }, { "name": "OH_Drawing_ColorFilterCreateBlendMode" }, { "name": "OH_Drawing_ColorFilterCreateCompose" },