diff --git a/graphic/graphic_2d/native_drawing/drawing_image_filter.h b/graphic/graphic_2d/native_drawing/drawing_image_filter.h index d77292aa373122d42569a029b9ca7dc448cefae1..08ed39fb6aeffe600ebb4ecb7bb1c8776f732455 100644 --- a/graphic/graphic_2d/native_drawing/drawing_image_filter.h +++ b/graphic/graphic_2d/native_drawing/drawing_image_filter.h @@ -63,6 +63,24 @@ extern "C" { OH_Drawing_ImageFilter* OH_Drawing_ImageFilterCreateBlur(float sigmaX, float sigmaY, OH_Drawing_TileMode, OH_Drawing_ImageFilter*); +/** + * @brief Creates OH_Drawing_ImageFilter object that combines the "inner" and "outer", so that the result + * of the "inner" is considered as a source bitmap passed to the "outer". + * + * This API generates an error code, you can view the value of the error code by using {@link OH_Drawing_ErrorCodeGet}. + * Returns OH_DRAWING_SUCCESS when the execution is successful; + * When either cOuter or cInner is null, OH_DRAWING_ERROR_INVALID_PARAMETER is returned. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param cOuter Indicates the instance to apply its effects to the output of the 'inner' filter. + * @param cInner Indicates the output as input for "outer" filters. + * @return Returns the pointer to the OH_Drawing_ImageFilter object created. + * @since 14 + * @version 1.0 + */ +OH_Drawing_ImageFilter* OH_Drawing_ImageFilterCreateComposeImageFilter( + OH_Drawing_ImageFilter* cOuter, OH_Drawing_ImageFilter* cInner); + /** * @brief Creates an OH_Drawing_ImageFilter object that applies the color filter to the input. * @@ -78,6 +96,44 @@ OH_Drawing_ImageFilter* OH_Drawing_ImageFilterCreateBlur(float sigmaX, float sig */ OH_Drawing_ImageFilter* OH_Drawing_ImageFilterCreateFromColorFilter(OH_Drawing_ColorFilter*, OH_Drawing_ImageFilter*); +/** + * @brief Creates an OH_Drawing_ImageFilter object that instance with the provided x and y offset. + * + * This API generates an error code, you can view the value of the error code by using {@link OH_Drawing_ErrorCodeGet}. + * Returns OH_DRAWING_SUCCESS when the execution is successful. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param dx Indicates the offset in the X direction. + * @param dy Indicates the offset in the Y direction. + * @param cInput Indicates the input image filter used to generate offset effects, or uses the source bitmap if this is + * null. + * @param cCropRect Indicates the rectangular object that defines the area to which the layer is applied. if the + * rectangle is null, the entire image will be processed. + * @return Returns the pointer to the OH_Drawing_ImageFilter object created. + * @since 14 + * @version 1.0 + */ +OH_Drawing_ImageFilter* OH_Drawing_ImageFilterCreateOffsetImageFilter( + float dx, float dy, OH_Drawing_ImageFilter* cInput, OH_Drawing_Rect* cCropRect); + +/** + * @brief Creates an OH_Drawing_ImageFilter object that renders the contents of the input Shader. + * + * This API generates an error code, you can view the value of the error code by using {@link OH_Drawing_ErrorCodeGet}. + * Returns OH_DRAWING_SUCCESS when the execution is successful; + * Returns OH_DRAWING_ERROR_INVALID_PARAMETER when cShader is null. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param cShader Indicates the shader effect to be applied to the image. + * @param cCropRect Indicates the rectangular object that defines the area to which the layer is applied. if the + * rectangle is null, the entire image will be processed. + * @return Returns the pointer to the OH_Drawing_ImageFilter object created. + * @since 14 + * @version 1.0 + */ +OH_Drawing_ImageFilter* OH_Drawing_ImageFilterCreateShaderImageFilter( + OH_Drawing_ShaderEffect* cShader, OH_Drawing_Rect* cCropRect); + /** * @brief Destroys an OH_Drawing_ImageFilter 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 e81640a3fa4218b59fb9dc031eb4e7b90db2a47b..6a32e66810161afa3b86a397505d71caf14e4e5e 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -298,6 +298,10 @@ "first_introduced": "12", "name": "OH_Drawing_ImageFilterCreateBlur" }, + { + "first_introduced": "14", + "name": "OH_Drawing_ImageFilterCreateComposeImageFilter" + }, { "first_introduced": "12", "name": "OH_Drawing_ImageFilterCreateFromColorFilter" @@ -306,6 +310,14 @@ "first_introduced": "12", "name": "OH_Drawing_ImageFilterDestroy" }, + { + "first_introduced": "14", + "name": "OH_Drawing_ImageFilterCreateOffsetImageFilter" + }, + { + "first_introduced": "14", + "name": "OH_Drawing_ImageFilterCreateShaderImageFilter" + }, { "name": "OH_Drawing_MaskFilterCreateBlur" }, { "name": "OH_Drawing_MaskFilterDestroy" }, { "name": "OH_Drawing_MatrixCreate" },