From 7b382997c6b49c3a20ddfe7fd9f93ce996cfd3d7 Mon Sep 17 00:00:00 2001 From: lw19901203 Date: Mon, 28 Oct 2024 10:49:25 +0800 Subject: [PATCH 1/2] updata image_filter. Signed-off-by: lw19901203 Change-Id: I7d52029c7a73db9f91fb59b1a6454231eaa61db2 --- .../native_drawing/drawing_image_filter.h | 39 +++++++++++++++++++ .../native_drawing/libnative_drawing.ndk.json | 12 ++++++ 2 files changed, 51 insertions(+) diff --git a/graphic/graphic_2d/native_drawing/drawing_image_filter.h b/graphic/graphic_2d/native_drawing/drawing_image_filter.h index d77292aa3..14382e753 100644 --- a/graphic/graphic_2d/native_drawing/drawing_image_filter.h +++ b/graphic/graphic_2d/native_drawing/drawing_image_filter.h @@ -78,6 +78,45 @@ 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 applies the bitmap to the input. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_Bitmap Indicates the pointer to an OH_Drawing_Bitmap object. + * @return Returns the pointer to the OH_Drawing_ImageFilter object created. + * @since 14 + * @version 1.0 + */ +OH_Drawing_ImageFilter* OH_Drawing_ImageFilterCreateFromBitmap(const OH_Drawing_Bitmap* cBitmap); + +/** + * @brief Creates an OH_Drawing_ImageFilter object that applies the bitmap with rect to the input. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_Bitmap Indicates the pointer to an OH_Drawing_Bitmap object. + * @param cSrcRect Indicates the pointer to a src rect object. + * @param cDstRect Indicates the pointer to a dst rect object. + * @return Returns the pointer to the OH_Drawing_ImageFilter object created. + * @since 14 + * @version 1.0 + */ +OH_Drawing_ImageFilter* OH_Drawing_ImageFilterCreateFromBitmapWithRect( + const OH_Drawing_Bitmap* cBitmap, const OH_Drawing_Rect* cSrcRect, const OH_Drawing_Rect* cDstRect); + +/** + * @brief Creates an OH_Drawing_ImageFilter object that applies the blend to the input. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_Bitmap Indicates the pointer to an OH_Drawing_Bitmap object. + * @param cBackground Indicates the background filter. + * @param cForeground Indicates the foreground filter. + * @return Returns the pointer to the OH_Drawing_ImageFilter object created. + * @since 14 + * @version 1.0 + */ +OH_Drawing_ImageFilter* OH_Drawing_ImageFilterCreateFromBlend( + OH_Drawing_BlendMode* cBlendMode, OH_Drawing_ImageFilter* cBackground, OH_Drawing_ImageFilter* cForeground); + /** * @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 353ce3f53..53eeda779 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -298,6 +298,18 @@ "first_introduced": "12", "name": "OH_Drawing_ImageFilterCreateBlur" }, + { + "first_introduced": "14", + "name": "OH_Drawing_ImageFilterCreateFromBitmap" + }, + { + "first_introduced": "14", + "name": "OH_Drawing_ImageFilterCreateFromBitmapWithRect" + }, + { + "first_introduced": "14", + "name": "OH_Drawing_ImageFilterCreateFromBlend" + }, { "first_introduced": "12", "name": "OH_Drawing_ImageFilterCreateFromColorFilter" -- Gitee From cdce9fa502ce8551551e4d48451b00451666d46b Mon Sep 17 00:00:00 2001 From: lvshiqi Date: Wed, 13 Nov 2024 10:02:11 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lvshiqi Change-Id: I8b9ee1c180c72ebd71327816f218281f3ed3c4ca --- graphic/graphic_2d/native_drawing/drawing_image_filter.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_image_filter.h b/graphic/graphic_2d/native_drawing/drawing_image_filter.h index 14382e753..de26fd58e 100644 --- a/graphic/graphic_2d/native_drawing/drawing_image_filter.h +++ b/graphic/graphic_2d/native_drawing/drawing_image_filter.h @@ -82,7 +82,7 @@ OH_Drawing_ImageFilter* OH_Drawing_ImageFilterCreateFromColorFilter(OH_Drawing_C * @brief Creates an OH_Drawing_ImageFilter object that applies the bitmap to the input. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Bitmap Indicates the pointer to an OH_Drawing_Bitmap object. + * @param cBitmap Indicates the pointer to an OH_Drawing_Bitmap object. * @return Returns the pointer to the OH_Drawing_ImageFilter object created. * @since 14 * @version 1.0 @@ -93,7 +93,7 @@ OH_Drawing_ImageFilter* OH_Drawing_ImageFilterCreateFromBitmap(const OH_Drawing_ * @brief Creates an OH_Drawing_ImageFilter object that applies the bitmap with rect to the input. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Bitmap Indicates the pointer to an OH_Drawing_Bitmap object. + * @param cBitmap Indicates the pointer to an OH_Drawing_Bitmap object. * @param cSrcRect Indicates the pointer to a src rect object. * @param cDstRect Indicates the pointer to a dst rect object. * @return Returns the pointer to the OH_Drawing_ImageFilter object created. @@ -107,7 +107,7 @@ OH_Drawing_ImageFilter* OH_Drawing_ImageFilterCreateFromBitmapWithRect( * @brief Creates an OH_Drawing_ImageFilter object that applies the blend to the input. * * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @param OH_Drawing_Bitmap Indicates the pointer to an OH_Drawing_Bitmap object. + * @param cBlendMode Indicates the pointer to an OH_Drawing_BlendMode object. * @param cBackground Indicates the background filter. * @param cForeground Indicates the foreground filter. * @return Returns the pointer to the OH_Drawing_ImageFilter object created. -- Gitee