diff --git a/graphic/graphic_2d/native_drawing/drawing_canvas.h b/graphic/graphic_2d/native_drawing/drawing_canvas.h index 10824c04c8f0eebe2111022d16d5d3b082d7bd0c..b0be244d5a8cbe2c912ed6430b7e43c199d03539 100644 --- a/graphic/graphic_2d/native_drawing/drawing_canvas.h +++ b/graphic/graphic_2d/native_drawing/drawing_canvas.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Copyright (c) 2021-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -271,6 +271,23 @@ OH_Drawing_ErrorCode OH_Drawing_CanvasDrawPixelMapNine(OH_Drawing_Canvas* canvas void OH_Drawing_CanvasDrawPixelMapRect(OH_Drawing_Canvas* canvas, OH_Drawing_PixelMap* pixelMap, const OH_Drawing_Rect* src, const OH_Drawing_Rect* dst, const OH_Drawing_SamplingOptions* samplingOptions); +// todo modify +/** + * @brief Draw the specified area of the Media::PixelMap to the specified area of the canvas. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_Canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param OH_Drawing_PixelMap Indicates the pointer to an OH_Drawing_PixelMap object. + * @param src the area of source pixelmap. + * @param dst the area of destination canvas. + * @param OH_Drawing_SamplingOptions the sampling mode. + * @since 12 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_CanvasDrawPixelMapRectConstraint(OH_Drawing_Canvas*, OH_Drawing_PixelMap*, + const OH_Drawing_Rect* src, const OH_Drawing_Rect* dst, const OH_Drawing_SamplingOptions*, + OH_Drawing_SrcRectConstraint); + /** * @brief Fills clipped canvas area with brush. * diff --git a/graphic/graphic_2d/native_drawing/drawing_image_filter.h b/graphic/graphic_2d/native_drawing/drawing_image_filter.h index a67f2353193bd9fbcc3c590fbe1824b938df1695..abf80521df779b25eb96490e6cfd288b1074415a 100644 --- a/graphic/graphic_2d/native_drawing/drawing_image_filter.h +++ b/graphic/graphic_2d/native_drawing/drawing_image_filter.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * Copyright (c) 2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -63,6 +63,23 @@ extern "C" { OH_Drawing_ImageFilter* OH_Drawing_ImageFilterCreateBlur(float sigmaX, float sigmaY, OH_Drawing_TileMode tileMode, OH_Drawing_ImageFilter* imageFilter); +// todo modify +/** + * @brief Creates an OH_Drawing_ImageFilter object that blurs its input by the separate x and y sigmas. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param sigmaX Indicates the Gaussian sigma value for blurring along the x axis. + * @param sigmaY Indicates the Gaussian sigma value for blurring along the y axis. + * @param OH_Drawing_TileMode Indicates the tile mode applied at edges. + * @param OH_Drawing_ImageFilter Indicates the input filter that is blurred, uses source bitmap if this is null. + * @param OH_Drawing_Rect Indicates the input filter that is blurred, uses source bitmap if this is null. + * @return Returns the pointer to the OH_Drawing_ImageFilter object created. + * @since 12 + * @version 1.0 + */ +OH_Drawing_ImageFilter* OH_Drawing_ImageFilterCreateBlurWithCrop(float sigmaX, float sigmaY, OH_Drawing_TileMode, + OH_Drawing_ImageFilter*, const OH_Drawing_Rect*); + /** * @brief Creates an OH_Drawing_ImageFilter object that applies the color filter to the input. * diff --git a/graphic/graphic_2d/native_drawing/drawing_sampling_options.h b/graphic/graphic_2d/native_drawing/drawing_sampling_options.h index 12a90a087976fd9ac76ee607786ac032dc9b9d44..a8f83cdec276b149b9a26eea183dd57fcd29b636 100644 --- a/graphic/graphic_2d/native_drawing/drawing_sampling_options.h +++ b/graphic/graphic_2d/native_drawing/drawing_sampling_options.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023-2024 Huawei Device Co., Ltd. + * Copyright (c) 2023-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -87,6 +87,18 @@ typedef enum { OH_Drawing_SamplingOptions* OH_Drawing_SamplingOptionsCreate(OH_Drawing_FilterMode filterMode, OH_Drawing_MipmapMode mipmapMode); +// todo modify +/** + * @brief Creates an OH_Drawing_SamplingOptions copy object. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @param OH_Drawing_SamplingOptions sIndicates the pointer to an OH_Drawing_SamplingOptions object. + * @return Returns the pointer to the OH_Drawing_SamplingOptions object created. + * @since 12 + * @version 1.0 + */ +OH_Drawing_SamplingOptions* OH_Drawing_SamplingOptionsCopy(OH_Drawing_SamplingOptions*); + /** * @brief Destroys an OH_Drawing_SamplingOptions 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 cd1b53c1f7bb7eb8770b6dd0710b07bb72a65d1e..bf9b8c17c2e2424fa60062f62f742bcde269c58f 100644 --- a/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json +++ b/graphic/graphic_2d/native_drawing/libnative_drawing.ndk.json @@ -76,6 +76,10 @@ "first_introduced": "12", "name": "OH_Drawing_CanvasDrawPixelMapRect" }, + { + "first_introduced": "20", + "name": "OH_Drawing_CanvasDrawPixelMapRectConstraint" + }, { "first_introduced": "12", "name": "OH_Drawing_CanvasDrawPoints" @@ -358,6 +362,10 @@ "first_introduced": "12", "name": "OH_Drawing_ImageFilterCreateBlur" }, + { + "first_introduced": "20", + "name": "OH_Drawing_ImageFilterCreateBlurWithCrop" + }, { "first_introduced": "12", "name": "OH_Drawing_ImageFilterCreateFromColorFilter" @@ -869,6 +877,10 @@ "name": "OH_Drawing_ImageGetImageInfo" }, { "name": "OH_Drawing_SamplingOptionsCreate" }, + { + "first_introduced": "20", + "name": "OH_Drawing_SamplingOptionsCopy" + }, { "name": "OH_Drawing_SamplingOptionsDestroy" }, { "first_introduced": "12",